Package com.iplanet.am.util
Class UnicodeInputStreamReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- com.iplanet.am.util.UnicodeInputStreamReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class UnicodeInputStreamReader extends FilterReader
TheUnicodeInputStreamReader
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.
-
-
Field Summary
-
Fields inherited from class java.io.FilterReader
in
-
-
Constructor Summary
Constructors Constructor Description UnicodeInputStreamReader(InputStream is)
Creates a Unicode input stream reader that reads from the given stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
markSupported()
int
read()
Read one character from the stream.int
read(char[] cbuf, int off, int len)
Read up to len characters from the stream and put them in cbuf starting at offset off.-
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
-
-
-
Constructor Detail
-
UnicodeInputStreamReader
public UnicodeInputStreamReader(InputStream is) throws UnsupportedEncodingException
Creates a Unicode input stream reader that reads from the given stream.- Parameters:
is
- the InputStream from which to read- Throws:
UnsupportedEncodingException
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classFilterReader
-
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 classFilterReader
- 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 classFilterReader
- Parameters:
cbuf
- the array of characters that is filled inoff
- the offset at which to start placing characterslen
- the maximum number of characters to read- Returns:
- the number of characters read
- Throws:
IOException
-
-