Class UnicodeInputStreamReader

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

    public class UnicodeInputStreamReader
    extends FilterReader
    The UnicodeInputStreamReader class converts from a byte stream that contains Java Unicode encoded characters (\\uXXXX) to Unicode characters. It can be used to read files that have been produced using the native2ascii tool.
    • Method Detail

      • read

        public int read()
                 throws IOException
        Read one character from the stream. See the other read method for information on decoding that is performed.
        Overrides:
        read in class FilterReader
        Returns:
        -1 on end of input, otherwise the character that was read
        Throws:
        IOException
      • read

        public int read​(char[] cbuf,
                        int off,
                        int len)
                 throws IOException
        Read up to len characters from the stream and put them in cbuf starting at offset off. As characters are read, the following conversions are performed: \\uXXXX is converted to one Unicode character having the value represented by the four hex digits. \\ is converted to \ \X any character preceded by \ is converted to that character.
        Overrides:
        read in class FilterReader
        Parameters:
        cbuf - the array of characters that is filled in
        off - the offset at which to start placing characters
        len - the maximum number of characters to read
        Returns:
        the number of characters read
        Throws:
        IOException