Class CharactersetEncoder.EncodedChars

  • Enclosing class:
    CharactersetEncoder

    public static class CharactersetEncoder.EncodedChars
    extends java.lang.Object
    A container for encoded character bytes
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] bytes  
      private boolean isDBCS  
      private int length  
      private int offset  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private EncodedChars​(byte[] bytes, boolean isDBCS)  
      private EncodedChars​(byte[] bytes, int offset, int length, boolean isDBCS)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getBytes()
      The bytes
      int getLength()
      The number of containing bytes.
      boolean isDBCS()
      Indicates whether or not the EncodedChars object wraps double byte characters.
      void writeTo​(java.io.OutputStream out, int offset, int length)
      write length bytes from offset to the output stream
      • Methods inherited from class java.lang.Object

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

      • bytes

        private final byte[] bytes
      • offset

        private final int offset
      • length

        private final int length
      • isDBCS

        private final boolean isDBCS
    • Constructor Detail

      • EncodedChars

        private EncodedChars​(byte[] bytes,
                             int offset,
                             int length,
                             boolean isDBCS)
      • EncodedChars

        private EncodedChars​(byte[] bytes,
                             boolean isDBCS)
    • Method Detail

      • writeTo

        public void writeTo​(java.io.OutputStream out,
                            int offset,
                            int length)
                     throws java.io.IOException
        write length bytes from offset to the output stream
        Parameters:
        out - output to write the bytes to
        offset - the offset where to write
        length - the length to write
        Throws:
        java.io.IOException - if an I/O error occurs
      • getLength

        public int getLength()
        The number of containing bytes.
        Returns:
        the length
      • isDBCS

        public boolean isDBCS()
        Indicates whether or not the EncodedChars object wraps double byte characters.
        Returns:
        true if the wrapped characters are double byte (DBCSs)
      • getBytes

        public byte[] getBytes()
        The bytes
        Returns:
        the bytes