Package org.cryptacular.io
Class DecodingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.cryptacular.io.DecodingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Filters read bytes through a
Decoder
such that consumers obtain raw (decoded) bytes from read operations.- Author:
- Middleware Services
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance that wraps the given stream and performs decoding using the given encoder component. -
Method Summary
Modifier and TypeMethodDescriptionstatic DecodingInputStream
base64
(InputStream in) Creates a new instance that decodes base64 input from the given stream.static DecodingInputStream
hex
(InputStream in) Creates a new instance that decodes hexadecimal input from the given stream.int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
DecodingInputStream
Creates a new instance that wraps the given stream and performs decoding using the given encoder component.- Parameters:
in
- Input stream to wrap.d
- Decoder that provides on-the-fly decoding.
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
base64
Creates a new instance that decodes base64 input from the given stream.- Parameters:
in
- Wrapped input stream.- Returns:
- Decoding input stream that decodes base64 output.
-
hex
Creates a new instance that decodes hexadecimal input from the given stream.- Parameters:
in
- Wrapped input stream.- Returns:
- Decoding input stream that decodes hexadecimal output.
-