public class FrameDecoder extends Object implements IBaseDecoder<ByteBuffer,Frame>
Constructor and Description |
---|
FrameDecoder(boolean clientMode,
boolean allowExtensions,
long maxPayloadLen)
Constructs a Web Socket decoder.
|
Modifier and Type | Method and Description |
---|---|
int |
available(ISession session,
byte[] buffer,
int off,
int len) |
int |
available(ISession session,
ByteBuffer buffer,
boolean flipped) |
void |
decode(ISession session,
ByteBuffer data,
List<Frame> out) |
Class<ByteBuffer> |
getInboundType() |
Class<Frame> |
getOutboundType() |
public FrameDecoder(boolean clientMode, boolean allowExtensions, long maxPayloadLen)
clientMode
- determines the mode (client/server) in which the
decoder should workallowExtensions
- determines it the decoder should allow to use the
reserved extension bitsmaxPayloadLen
- maximum length of a frame's payload data. Setting it
to an appropriate value can prevent from denial of
service attackspublic Class<ByteBuffer> getInboundType()
getInboundType
in interface ICodec<ByteBuffer,Frame>
public Class<Frame> getOutboundType()
getOutboundType
in interface ICodec<ByteBuffer,Frame>
public void decode(ISession session, ByteBuffer data, List<Frame> out) throws Exception
decode
in interface IDecoder<ByteBuffer,Frame>
Exception
public int available(ISession session, ByteBuffer buffer, boolean flipped)
available
in interface IBaseDecoder<ByteBuffer,Frame>
public int available(ISession session, byte[] buffer, int off, int len)
available
in interface IBaseDecoder<ByteBuffer,Frame>
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.