Class UTF16Decoder

java.lang.Object
org.apache.batik.util.io.AbstractCharDecoder
org.apache.batik.util.io.UTF16Decoder
All Implemented Interfaces:
CharDecoder

public class UTF16Decoder extends AbstractCharDecoder
This class represents an object which decodes UTF-16 characters from a stream of bytes.
Version:
$Id: UTF16Decoder.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Details

    • bigEndian

      protected boolean bigEndian
      Whether the stream's byte-order is big-endian.
  • Constructor Details

    • UTF16Decoder

      public UTF16Decoder(InputStream is) throws IOException
      Creates a new UTF16Decoder. It is assumed that the byte-order mark is present.
      Parameters:
      is - The stream to decode.
      Throws:
      IOException
    • UTF16Decoder

      public UTF16Decoder(InputStream is, boolean be)
      Creates a new UTF16Decoder.
      Parameters:
      is - The stream to decode.
      be - Whether or not the given stream's byte-order is big-endian.
  • Method Details

    • readChar

      public int readChar() throws IOException
      Reads the next character.
      Returns:
      a character or END_OF_STREAM.
      Throws:
      IOException