- java.lang.Object
-
- java.io.InputStream
-
- org.refcodes.security.DecryptionInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.refcodes.mixin.Disposable
public class DecryptionInputStream extends InputStream implements org.refcodes.mixin.Disposable
ADecryptionInputStreamwraps anInputStreamand consumes input bytes by applying aDecrypteron each byte read from the providedInputStreambefore passing back the processed byte to the caller. The input of theDecryptionInputStreamcan be converted back by the accordingEncryptionOutputStream.
-
-
Constructor Summary
Constructors Constructor Description DecryptionInputStream(InputStream aInputStream, Decrypter<byte[],byte[],DecryptionException> aDecrypter)Constructs theDecryptionInputStreamby wrapping the givenInputStreamfor the providedDecrypterto be applied on the bytes to be read.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voiddispose()booleanequals(Object aObj)inthashCode()voidmark(int aReadlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()longskip(long aArg0)StringtoString()-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
DecryptionInputStream
public DecryptionInputStream(InputStream aInputStream, Decrypter<byte[],byte[],DecryptionException> aDecrypter)
Constructs theDecryptionInputStreamby wrapping the givenInputStreamfor the providedDecrypterto be applied on the bytes to be read.- Parameters:
aInputStream- TheInputStreamto be wrapped.aDecrypter- TheDecrypterto be applied to the bytes to be read.
-
-
Method Detail
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
mark
public void mark(int aReadlimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
public long skip(long aArg0) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
dispose
public void dispose()
- Specified by:
disposein interfaceorg.refcodes.mixin.Disposable
-
-