Closeable
, AutoCloseable
public final class DecoderStream extends FilterInputStream
InputStream
that provides on-the-fly decoding from an underlying
stream.
EncoderStream
,
Decoder
Modifier and Type | Field | Description |
---|---|---|
protected ByteBuffer |
buffer |
|
protected Decoder |
decoder |
in
Constructor | Description |
---|---|
DecoderStream(InputStream pStream,
Decoder pDecoder) |
Creates a new decoder stream and chains it to the
input stream specified by the
pStream argument. |
DecoderStream(InputStream pStream,
Decoder pDecoder,
int pBufferSize) |
Creates a new decoder stream and chains it to the
input stream specified by the
pStream argument. |
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
|
protected int |
fill() |
Fills the buffer, by decoding data from the underlying input stream.
|
int |
read() |
|
int |
read(byte[] pBytes,
int pOffset,
int pLength) |
|
long |
skip(long pLength) |
close, mark, markSupported, read, reset
readAllBytes, readNBytes, transferTo
protected final ByteBuffer buffer
protected final Decoder decoder
public DecoderStream(InputStream pStream, Decoder pDecoder)
pStream
argument.
The stream will use a default decode buffer size.pStream
- the underlying input stream.pDecoder
- the decoder that will be used to decode the underlying streamFilterInputStream.in
public DecoderStream(InputStream pStream, Decoder pDecoder, int pBufferSize)
pStream
argument.pStream
- the underlying input stream.pDecoder
- the decoder that will be used to decode the underlying streampBufferSize
- the size of the decode bufferFilterInputStream.in
public int available() throws IOException
available
in class FilterInputStream
IOException
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] pBytes, int pOffset, int pLength) throws IOException
read
in class FilterInputStream
IOException
public long skip(long pLength) throws IOException
skip
in class FilterInputStream
IOException
protected int fill() throws IOException
-1
if the end of the
file is reachedIOException
- if an I/O error occursCopyright © 2018. All rights reserved.