Class CharsetDecoderBlock


  • public class CharsetDecoderBlock
    extends PipelineBlock<byte[],​char[]>
    A PipelineBlock, which converts stream of bytes supplied as byte[] arrays to an array of char[] using the specified encoding. Decoding errors (malformed input and unmappable characters) are to handled by dropping the erroneous input, appending the coder's replacement value to the output buffer, and resuming the coding operation.
    • Field Detail

      • EMPTY_PORTION

        public static final char[] EMPTY_PORTION
        Empty portion.
    • Constructor Detail

      • CharsetDecoderBlock

        public CharsetDecoderBlock​(Charset charset)
        Creates charset decoder block.
        Parameters:
        charset - The charset encoding to decode bytes from.
    • Method Detail

      • accept

        public void accept​(byte[] data,
                           boolean isLastAppend)
                    throws IgniteCheckedException
        Accepts a portion of input. isLastPortion parameter should be set if this is a last portion of the input. The method must not be called after the end of input: the call with isLastPortion == true is the last one.
        Specified by:
        accept in class PipelineBlock<byte[],​char[]>
        Parameters:
        data - Portion of input.
        isLastAppend - Is this the last portion.
        Throws:
        IgniteCheckedException - On error.