| java.lang.Object org.apache.mina.filter.codec.prefixedstring.PrefixedStringCodecFactory
PrefixedStringCodecFactory | public class PrefixedStringCodecFactory implements ProtocolCodecFactory(Code) | | A
ProtocolCodecFactory that performs encoding and decoding
of a Java String object using a fixed-length length prefix.
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 596187 $, $Date: 2007-11-19 04:41:14 +0100 (ma, 19 nov 2007) $ |
PrefixedStringCodecFactory | public PrefixedStringCodecFactory(Charset charset)(Code) | | |
PrefixedStringCodecFactory | public PrefixedStringCodecFactory()(Code) | | |
getDecoderPrefixLength | public int getDecoderPrefixLength()(Code) | | Gets the length of the length prefix (1, 2, or 4) used by the decoder
length of the length prefix |
getEncoderPrefixLength | public int getEncoderPrefixLength()(Code) | | Gets the length of the length prefix (1, 2, or 4) used by the encoder
length of the length prefix |
setDecoderMaxDataLength | public void setDecoderMaxDataLength(int maxDataLength)(Code) | | Sets the maximum allowed value specified as data length in the decoded data
Useful for preventing an OutOfMemory attack by the peer.
The decoder will throw a
BufferDataException when data length
specified in the incoming data is greater than maxDataLength
The default value is
PrefixedStringDecoder.DEFAULT_MAX_DATA_LENGTH .
This method does the same job as
PrefixedStringDecoder.setMaxDataLength(int) .
Parameters: maxDataLength - maximum allowed value specified as data length in the incoming data |
setDecoderPrefixLength | public void setDecoderPrefixLength(int prefixLength)(Code) | | Sets the length of the prefix used by the decoder
Parameters: prefixLength - the length of the length prefix (1, 2, or 4) |
setEncoderPrefixLength | public void setEncoderPrefixLength(int prefixLength)(Code) | | Sets the length of the prefix used by the encoder
Parameters: prefixLength - the length of the length prefix (1, 2, or 4) |
|
|