Class TextLineCodecFactory

    • Constructor Detail

      • 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. The encoder uses a UNIX LineDelimiter and the decoder uses the AUTO LineDelimiter.
        Parameters:
        charset - The charset to use in the encoding and decoding
      • TextLineCodecFactory

        public TextLineCodecFactory​(Charset charset,
                                    String encodingDelimiter,
                                    String decodingDelimiter)
        Creates a new instance of TextLineCodecFactory. This constructor provides more flexibility for the developer.
        Parameters:
        charset - The charset to use in the encoding and decoding
        encodingDelimiter - The line delimeter for the encoder
        decodingDelimiter - The line delimeter for the decoder
      • TextLineCodecFactory

        public TextLineCodecFactory​(Charset charset,
                                    LineDelimiter encodingDelimiter,
                                    LineDelimiter decodingDelimiter)
        Creates a new instance of TextLineCodecFactory. This constructor provides more flexibility for the developer.
        Parameters:
        charset - The charset to use in the encoding and decoding
        encodingDelimiter - The line delimeter for the encoder
        decodingDelimiter - The line delimeter for the decoder
    • Method Detail

      • 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).

        Parameters:
        maxLineLength - The maximum encoded line length
      • 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().

      • setDecoderMaxLineLength

        public void setDecoderMaxLineLength​(int maxLineLength)
        Sets 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.setMaxLineLength(int).

        Parameters:
        maxLineLength - the maximum decoded line length