org.apache.mina.filter.codec.textline
Class TextLineCodecFactory
java.lang.Object
org.apache.mina.filter.codec.textline.TextLineCodecFactory
- ProtocolCodecFactory
public class TextLineCodecFactory
extends java.lang.Object
A
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.
TextLineCodecFactory
public TextLineCodecFactory()
Creates a new instance with the current default Charset
.
TextLineCodecFactory
public TextLineCodecFactory(Charset charset)
Creates a new instance with the specified Charset
.
getDecoderMaxLineLength
public int getDecoderMaxLineLength()
Returns the allowed maximum size of the line to be decoded.
If the size of the line to be decoded exceeds this value, the
decoder will throw a
BufferDataException
. The default
value is
1024 (1KB).
This method does the same job with
TextLineDecoder.getMaxLineLength()
.
getEncoderMaxLineLength
public int getEncoderMaxLineLength()
Returns the allowed maximum size of the encoded line.
If the size of the encoded line exceeds this value, the encoder
will throw a
IllegalArgumentException
. The default value
is
Integer.MAX_VALUE
.
This method does the same job with
TextLineEncoder.getMaxLineLength()
.
setDecoderMaxLineLength
public void setDecoderMaxLineLength(int maxLineLength)
setEncoderMaxLineLength
public void setEncoderMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the encoded line.
If the size of the encoded line exceeds this value, the encoder
will throw a
IllegalArgumentException
. The default value
is
Integer.MAX_VALUE
.
This method does the same job with
TextLineEncoder.setMaxLineLength(int)
.