public class Utf8Reader extends Reader
| Constructor and Description |
|---|
Utf8Reader(byte[] ab)
Construct a Utf8Reader that reads the input from a byte array.
|
Utf8Reader(InputStream stream)
Construct a Utf8Reader that reads the input from an InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the stream.
|
void |
mark(int cchLimit)
Mark the present position in the stream.
|
boolean |
markSupported()
Tell whether this stream supports the mark() operation.
|
int |
read()
Read a single character.
|
int |
read(char[] ach)
Read characters into an array.
|
int |
read(char[] ach, int of, int cch)
Read characters into a portion of an array.
|
boolean |
ready()
Tell whether this stream is ready to be read.
|
void |
reset()
Reset the stream.
|
long |
skip(long cch)
Skip characters.
|
public Utf8Reader(byte[] ab)
public Utf8Reader(InputStream stream)
stream - the underlying stream to write to
public int read()
throws IOException
Subclasses that intend to support efficient single-character input should override this method.
read in class ReaderIOException - If an I/O error occurs
public int read(char[] ach)
throws IOException
read in class Readerach - Destination bufferIOException - If an I/O error occurs
public int read(char[] ach,
int of,
int cch)
throws IOException
read in class Readerach - array of characters to read intoof - offset into the array at which to start storing characterscch - maximum number of characters to readIOException - If an I/O error occurs
public long skip(long cch)
throws IOException
skip in class Readercch - The number of characters to skipIllegalArgumentException - If n is negative.IOException - If an I/O error occurs
public boolean ready()
throws IOException
ready in class ReaderIOException - If an I/O error occurspublic boolean markSupported()
markSupported in class Reader
public void mark(int cchLimit)
throws IOException
mark in class ReadercchLimit - Limit on the number of characters that may be read while still preserving the mark. After reading this many characters, attempting to reset the stream may fail.IOException - If the stream does not support mark(), or if some other I/O error occurs
public void reset()
throws IOException
reset in class ReaderIOException - If the stream has not been marked, or if the mark has been invalidated, or if the stream does not support reset(), or if some other I/O error occurs
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException - If an I/O error occurs