Class DecoderStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.twelvemonkeys.io.enc.DecoderStream
- All Implemented Interfaces:
Closeable, AutoCloseable
An
InputStream that provides on-the-fly decoding from an underlying stream.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java#2 $
- See Also:
-
Field Summary
FieldsFields inherited from class FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionDecoderStream(InputStream stream, Decoder decoder) Creates a new decoder stream and chains it to the input stream specified by thestreamargument.DecoderStream(InputStream stream, Decoder decoder, int bufferSize) Creates a new decoder stream and chains it to the input stream specified by thestreamargument. -
Method Summary
Methods inherited from class FilterInputStream
close, mark, markSupported, read, resetMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
buffer
-
decoder
-
-
Constructor Details
-
DecoderStream
Creates a new decoder stream and chains it to the input stream specified by thestreamargument. The stream will use a default decode buffer size.- Parameters:
stream- the underlying input stream.decoder- the decoder that will be used to decode the underlying stream- See Also:
-
DecoderStream
Creates a new decoder stream and chains it to the input stream specified by thestreamargument.- Parameters:
stream- the underlying input stream.decoder- the decoder that will be used to decode the underlying streambufferSize- the size of the decode buffer- See Also:
-
-
Method Details
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
fill
Fills the buffer, by decoding data from the underlying input stream.- Returns:
- the number of bytes decoded, or
-1if the end of the file is reached - Throws:
IOException- if an I/O error occurs
-