| org.apache.mina.filter.codec.CumulativeProtocolDecoder org.apache.mina.filter.codec.prefixedstring.PrefixedStringDecoder
PrefixedStringDecoder | public class PrefixedStringDecoder extends CumulativeProtocolDecoder (Code) | | A
ProtocolDecoder which decodes a String using a fixed-length length prefix.
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 591182 $, $Date: 2007-11-02 01:59:27 +0100 (vr, 02 nov 2007) $, |
DEFAULT_MAX_DATA_LENGTH | final public static int DEFAULT_MAX_DATA_LENGTH(Code) | | |
DEFAULT_PREFIX_LENGTH | final public static int DEFAULT_PREFIX_LENGTH(Code) | | |
PrefixedStringDecoder | public PrefixedStringDecoder(Charset charset, int prefixLength, int maxDataLength)(Code) | | Parameters: charset - the charset to use for encoding Parameters: prefixLength - the length of the prefix Parameters: maxDataLength - maximum number of bytes allowed for a single String |
PrefixedStringDecoder | public PrefixedStringDecoder(Charset charset, int prefixLength)(Code) | | |
PrefixedStringDecoder | public PrefixedStringDecoder(Charset charset)(Code) | | |
getMaxDataLength | public int getMaxDataLength()(Code) | | Gets the maximum number of bytes allowed for a single String
maximum number of bytes allowed for a single String |
getPrefixLength | public int getPrefixLength()(Code) | | Gets the length of the length prefix (1, 2, or 4)
length of the length prefix |
setMaxDataLength | public void setMaxDataLength(int maxDataLength)(Code) | | Sets the maximum allowed value specified as data length in the incoming 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 .
Parameters: maxDataLength - maximum allowed value specified as data length in the incoming data |
setPrefixLength | public void setPrefixLength(int prefixLength)(Code) | | Sets the number of bytes used by the length prefix
Parameters: prefixLength - the length of the length prefix (1, 2, or 4) |
|
|