java.lang.Object
java.io.InputStream
org.refcodes.security.DecryptionInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.refcodes.mixin.Disposable
A
DecryptionInputStream
wraps an InputStream
and consumes
input bytes by applying a Decrypter
on each byte read from the
provided InputStream
before passing back the processed byte to the
caller. The input of the DecryptionInputStream
can be converted back
by the according EncryptionOutputStream
.-
Constructor Summary
ConstructorDescriptionDecryptionInputStream
(InputStream aInputStream, Decrypter<byte[], byte[], DecryptionException> aDecrypter) Constructs theDecryptionInputStream
by wrapping the givenInputStream
for the providedDecrypter
to be applied on the bytes to be read. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
DecryptionInputStream
public DecryptionInputStream(InputStream aInputStream, Decrypter<byte[], byte[], DecryptionException> aDecrypter) Constructs theDecryptionInputStream
by wrapping the givenInputStream
for the providedDecrypter
to be applied on the bytes to be read.- Parameters:
aInputStream
- TheInputStream
to be wrapped.aDecrypter
- TheDecrypter
to be applied to the bytes to be read.
-
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
mark
public void mark(int aReadlimit) - Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
dispose
public void dispose()- Specified by:
dispose
in interfaceorg.refcodes.mixin.Disposable
-
toString
-