public class Utf8InputStreamReader extends Reader
Utf8OutputStreamWriter
Constructor and Description |
---|
Utf8InputStreamReader(ByteArrayRange byteArrayRange) |
Utf8InputStreamReader(InputStream inputStream)
Constructs a new
InputStreamReader on the InputStream in . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this reader.
|
int |
read()
Reads a single character from this reader and returns it as an integer with the two higher-order bytes set to 0.
|
int |
read(char[] buffer,
int offset,
int length)
Reads at most
length characters from this reader and stores them at position offset in the
character array buf . |
public Utf8InputStreamReader(InputStream inputStream)
InputStreamReader
on the InputStream
in
. This constructor sets
the character converter to the encoding specified in the "file.encoding" property and falls back to ISO 8859_1
(ISO-Latin-1) if the property doesn't exist.inputStream
- the input stream from which to read characters.public Utf8InputStreamReader(ByteArrayRange byteArrayRange)
public void close()
close
in interface java.lang.AutoCloseable
close
in class AutoCloseable
public int read()
public int read(char[] buffer, int offset, int length)
length
characters from this reader and stores them at position offset
in the
character array buf
. Returns the number of characters actually read or -1 if the end of the reader has
been reached. The bytes are either obtained from converting bytes in this reader's buffer or by first filling the
buffer from the source InputStream and then reading from the buffer.read
in class Reader
buffer
- the array to store the characters readoffset
- the initial position in buf
to store the characters read from this readerlength
- the maximum number of characters to readCharConversionException
- if the stream isn't valid UTF-8