public class CharEncoderReader extends Reader
Reads encoded characters from raw bytes.
Counter-part to CharDecoderInputStream
.
This is a pull-interface; CharEncoderOutputStream
is the equivalent push-interface.
Can be adapted to read characters to the consumer (instead of raw bytes)
by wrapping in a InputStreamReader
.
Modifier and Type | Field and Description |
---|---|
protected IByteToCharEncoder |
encoder |
protected ByteBuffer |
readBuffer |
protected InputStream |
reader |
protected CodingStates |
state |
protected CharBuffer |
writeBuffer |
Constructor and Description |
---|
CharEncoderReader(IByteToCharEncoder encoder,
InputStream reader) |
CharEncoderReader(IByteToCharEncoder encoder,
InputStream reader,
int readBufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected boolean |
fillBuffer() |
int |
read(char[] cbuf,
int off,
int len) |
protected IByteToCharEncoder encoder
protected InputStream reader
protected ByteBuffer readBuffer
protected CharBuffer writeBuffer
protected CodingStates state
public CharEncoderReader(IByteToCharEncoder encoder, InputStream reader)
public CharEncoderReader(IByteToCharEncoder encoder, InputStream reader, int readBufferSize)
protected boolean fillBuffer() throws IOException
IOException
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
Copyright © 2009–2017 Mark A. Ziesemer. All rights reserved.