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 DecodingInputStreambase64(InputStream in) Creates a new instance that decodes base64 input from the given stream.static DecodingInputStreamhex(InputStream in) Creates a new instance that decodes hexadecimal input from the given stream.intread()intread(byte[] b) intread(byte[] b, int off, int len) Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
-
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:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin 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.
-