Class C2BConverter


  • public final class C2BConverter
    extends java.lang.Object
    NIO based character encoder.
    • Constructor Summary

      Constructors 
      Constructor Description
      C2BConverter​(java.nio.charset.Charset charset)
      Constructs a C2BConverter for the given charset.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void convert​(java.nio.CharBuffer cc, java.nio.ByteBuffer bc)
      Convert the given characters to bytes.
      void convert​(CharChunk cc, ByteChunk bc)
      Convert the given characters to bytes.
      java.nio.charset.Charset getCharset()
      Returns the charset used by this converter.
      boolean isUndeflow()
      Deprecated.
      boolean isUnderflow()
      Returns whether there are leftover characters pending encoding.
      void recycle()
      Reset the encoder state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • C2BConverter

        public C2BConverter​(java.nio.charset.Charset charset)
        Constructs a C2BConverter for the given charset.
        Parameters:
        charset - the charset to use for encoding
    • Method Detail

      • recycle

        public void recycle()
        Reset the encoder state.
      • isUnderflow

        public boolean isUnderflow()
        Returns whether there are leftover characters pending encoding.
        Returns:
        true if there are leftovers
      • isUndeflow

        @Deprecated
        public boolean isUndeflow()
        Deprecated.
        Returns whether there are leftover characters pending encoding.
        Returns:
        true if there are leftovers
      • convert

        public void convert​(CharChunk cc,
                            ByteChunk bc)
                     throws java.io.IOException
        Convert the given characters to bytes.
        Parameters:
        cc - char input
        bc - byte output
        Throws:
        java.io.IOException - An encoding error occurred
      • convert

        public void convert​(java.nio.CharBuffer cc,
                            java.nio.ByteBuffer bc)
                     throws java.io.IOException
        Convert the given characters to bytes.
        Parameters:
        cc - char input
        bc - byte output
        Throws:
        java.io.IOException - An encoding error occurred
      • getCharset

        public java.nio.charset.Charset getCharset()
        Returns the charset used by this converter.
        Returns:
        the charset