public class TextLineDecoder extends Object implements ProtocolDecoder
ProtocolDecoder which decodes a text line into a string.| Constructor and Description |
|---|
TextLineDecoder()
Creates a new instance with the current default
Charset
and LineDelimiter.AUTO delimiter. |
TextLineDecoder(Charset charset)
Creates a new instance with the spcified charset
and
LineDelimiter.AUTO delimiter. |
TextLineDecoder(Charset charset,
LineDelimiter delimiter)
Creates a new instance with the specified charset
and the specified delimiter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(IoSession session,
ByteBuffer in,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects.
|
void |
dispose(IoSession session)
Releases all resources related with this decoder.
|
void |
finishDecode(IoSession session,
ProtocolDecoderOutput out)
Invoked when the specified session is closed.
|
int |
getMaxLineLength()
Returns the allowed maximum size of the line to be decoded.
|
void |
setMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the line to be decoded.
|
public TextLineDecoder()
Charset
and LineDelimiter.AUTO delimiter.public TextLineDecoder(Charset charset)
LineDelimiter.AUTO delimiter.public TextLineDecoder(Charset charset, LineDelimiter delimiter)
public int getMaxLineLength()
BufferDataException. The default
value is 1024 (1KB).public void setMaxLineLength(int maxLineLength)
BufferDataException. The default
value is 1024 (1KB).public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
ProtocolDecoderProtocolDecoder.decode(IoSession, ByteBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput.decode in interface ProtocolDecoderException - if the read data violated protocol specificationpublic void finishDecode(IoSession session, ProtocolDecoderOutput out) throws Exception
ProtocolDecoderProtocolDecoder.decode(IoSession, ByteBuffer, ProtocolDecoderOutput)
method didn't process completely.finishDecode in interface ProtocolDecoderException - if the read data violated protocol specificationpublic void dispose(IoSession session) throws Exception
ProtocolDecoderdispose in interface ProtocolDecoderException - if failed to dispose all resourcesCopyright © 2004–2018 Apache MINA Project. All rights reserved.