public class Utf8StreamReader extends Reader
InputStreamReader
, but locked to
utf-8, and explicitly with no buffering whatsoever. It will only read one
byte at a time until it has a valid unicode char.
In order to make this reader more efficient, rather wrap the input stream in a BufferedInputStream, which can pass on any buffered bytes to later uses. E.g.:
Reader reader = new Utf8StreamReader(new BufferedInputStream(in));
Constructor and Description |
---|
Utf8StreamReader(InputStream in) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
read(char[] cbuf,
int off,
int len) |
boolean |
ready() |
public Utf8StreamReader(InputStream in)
public int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Reader
IOException
public boolean ready() throws IOException
ready
in class Reader
IOException
Copyright © 2017. All rights reserved.