/** * @return the allowed maximum size of a decoded string. * <p> * This method does the same job as {@link PrefixedStringEncoder#setMaxDataLength(int)}. * @see #setDecoderMaxDataLength(int) */ public int getDecoderMaxDataLength() { return decoder.getMaxDataLength(); }
/** * Gets the length of the length prefix (1, 2, or 4) used by the decoder * * @return length of the length prefix */ public int getDecoderPrefixLength() { return decoder.getPrefixLength(); }
/** * Sets the maximum allowed value specified as data length in the decoded data * <p> * Useful for preventing an OutOfMemory attack by the peer. * The decoder will throw a {@link BufferDataException} when data length * specified in the incoming data is greater than maxDataLength * The default value is {@link PrefixedStringDecoder#DEFAULT_MAX_DATA_LENGTH}. * <p> * This method does the same job as {@link PrefixedStringDecoder#setMaxDataLength(int)}. * * @param maxDataLength maximum allowed value specified as data length in the incoming data */ public void setDecoderMaxDataLength(int maxDataLength) { decoder.setMaxDataLength(maxDataLength); }
/** * Sets the length of the prefix used by the decoder * * @param prefixLength the length of the length prefix (1, 2, or 4) */ public void setDecoderPrefixLength(int prefixLength) { decoder.setPrefixLength(prefixLength); }
/** * Creates a new PrefixedStringCodecFactory instance * * @param charset The {@link Charset} to use for encoding or decoding */ public PrefixedStringCodecFactory(Charset charset) { encoder = new PrefixedStringEncoder(charset); decoder = new PrefixedStringDecoder(charset); }
/** * Sets the length of the prefix used by the decoder * * @param prefixLength the length of the length prefix (1, 2, or 4) */ public void setDecoderPrefixLength(int prefixLength) { decoder.setPrefixLength(prefixLength); }
/** * Creates a new PrefixedStringCodecFactory instance * * @param charset The {@link Charset} to use for encoding or decoding */ public PrefixedStringCodecFactory(Charset charset) { encoder = new PrefixedStringEncoder(charset); decoder = new PrefixedStringDecoder(charset); }
/** * Sets the length of the prefix used by the decoder * * @param prefixLength the length of the length prefix (1, 2, or 4) */ public void setDecoderPrefixLength(int prefixLength) { decoder.setPrefixLength(prefixLength); }
public PrefixedStringCodecFactory(Charset charset) { encoder = new PrefixedStringEncoder(charset); decoder = new PrefixedStringDecoder(charset); }
/** * Gets the length of the length prefix (1, 2, or 4) used by the decoder * * @return length of the length prefix */ public int getDecoderPrefixLength() { return decoder.getPrefixLength(); }
/** * Returns the allowed maximum size of a decoded string. * <p> * This method does the same job as {@link PrefixedStringEncoder#setMaxDataLength(int)}. * </p> * * @return the allowed maximum size of an encoded string. * @see #setDecoderMaxDataLength(int) */ public int getDecoderMaxDataLength() { return decoder.getMaxDataLength(); }
/** * Sets the maximum allowed value specified as data length in the decoded data * <p> * Useful for preventing an OutOfMemory attack by the peer. * The decoder will throw a {@link BufferDataException} when data length * specified in the incoming data is greater than maxDataLength * The default value is {@link PrefixedStringDecoder#DEFAULT_MAX_DATA_LENGTH}. * <p> * This method does the same job as {@link PrefixedStringDecoder#setMaxDataLength(int)}. * * @param maxDataLength maximum allowed value specified as data length in the incoming data */ public void setDecoderMaxDataLength(int maxDataLength) { decoder.setMaxDataLength(maxDataLength); }
/** * Gets the length of the length prefix (1, 2, or 4) used by the decoder * * @return length of the length prefix */ public int getDecoderPrefixLength() { return decoder.getPrefixLength(); }
/** * @return the allowed maximum size of a decoded string. * <p> * This method does the same job as {@link PrefixedStringEncoder#setMaxDataLength(int)}. * @see #setDecoderMaxDataLength(int) */ public int getDecoderMaxDataLength() { return decoder.getMaxDataLength(); }
/** * Sets the maximum allowed value specified as data length in the decoded data * <p> * Useful for preventing an OutOfMemory attack by the peer. * The decoder will throw a {@link BufferDataException} when data length * specified in the incoming data is greater than maxDataLength * The default value is {@link PrefixedStringDecoder#DEFAULT_MAX_DATA_LENGTH}. * * This method does the same job as {@link PrefixedStringDecoder#setMaxDataLength(int)}. * </p> * * @param maxDataLength maximum allowed value specified as data length in the incoming data */ public void setDecoderMaxDataLength(int maxDataLength) { decoder.setMaxDataLength(maxDataLength); }