public class TextLineCodecFactory extends java.lang.Object implements ProtocolCodecFactory
ProtocolCodecFactory
that performs encoding and decoding between
a text line data and a Java string object. This codec is useful especially
when you work with a text-based protocols such as SMTP and IMAP.Constructor and Description |
---|
TextLineCodecFactory()
Creates a new instance with the current default
Charset . |
TextLineCodecFactory(java.nio.charset.Charset charset)
Creates a new instance with the specified
Charset . |
Modifier and Type | Method and Description |
---|---|
ProtocolDecoder |
getDecoder()
Returns a new (or reusable) instance of
ProtocolDecoder which
decodes binary or protocol-specific data into message objects. |
int |
getDecoderMaxLineLength()
Returns the allowed maximum size of the line to be decoded.
|
ProtocolEncoder |
getEncoder()
Returns a new (or reusable) instance of
ProtocolEncoder which
encodes message objects into binary or protocol-specific data. |
int |
getEncoderMaxLineLength()
Returns the allowed maximum size of the encoded line.
|
void |
setDecoderMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the line to be decoded.
|
void |
setEncoderMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the encoded line.
|
public TextLineCodecFactory()
Charset
.public TextLineCodecFactory(java.nio.charset.Charset charset)
Charset
.public ProtocolEncoder getEncoder()
ProtocolCodecFactory
ProtocolEncoder
which
encodes message objects into binary or protocol-specific data.getEncoder
in interface ProtocolCodecFactory
public ProtocolDecoder getDecoder()
ProtocolCodecFactory
ProtocolDecoder
which
decodes binary or protocol-specific data into message objects.getDecoder
in interface ProtocolCodecFactory
public int getEncoderMaxLineLength()
IllegalArgumentException
. The default value
is Integer.MAX_VALUE
.
This method does the same job with TextLineEncoder.getMaxLineLength()
.
public void setEncoderMaxLineLength(int maxLineLength)
IllegalArgumentException
. The default value
is Integer.MAX_VALUE
.
This method does the same job with TextLineEncoder.setMaxLineLength(int)
.
public int getDecoderMaxLineLength()
BufferDataException
. The default
value is 1024 (1KB).
This method does the same job with TextLineDecoder.getMaxLineLength()
.
public void setDecoderMaxLineLength(int maxLineLength)
BufferDataException
. The default
value is 1024 (1KB).
This method does the same job with TextLineDecoder.setMaxLineLength(int)
.
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.