Class B2CConverter


  • public class B2CConverter
    extends Object
    NIO based character decoder.
    • Constructor Detail

      • B2CConverter

        public B2CConverter​(Charset charset)
      • B2CConverter

        public B2CConverter​(Charset charset,
                            boolean replaceOnError)
    • Method Detail

      • getCharset

        public static Charset getCharset​(String enc)
                                  throws UnsupportedEncodingException
        Obtain the Charset for the given encoding
        Parameters:
        enc - The name of the encoding for the required charset
        Returns:
        The Charset corresponding to the requested encoding
        Throws:
        UnsupportedEncodingException - If the requested Charset is not available
      • recycle

        public void recycle()
        Reset the decoder state.
      • convert

        public void convert​(ByteChunk bc,
                            CharChunk cc,
                            boolean endOfInput)
                     throws IOException
        Convert the given bytes to characters.
        Parameters:
        bc - byte input
        cc - char output
        endOfInput - Is this all of the available data
        Throws:
        IOException - If the conversion can not be completed
      • convert

        public void convert​(ByteBuffer bc,
                            CharBuffer cc,
                            ByteChunk.ByteInputChannel ic,
                            boolean endOfInput)
                     throws IOException
        Convert the given bytes to characters.
        Parameters:
        bc - byte input
        cc - char output
        ic - byte input channel
        endOfInput - Is this all of the available data
        Throws:
        IOException - If the conversion can not be completed
      • getCharset

        public Charset getCharset()