java.lang.Object
java.io.OutputStream
org.refcodes.security.EncryptionOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,org.refcodes.mixin.Disposable
A
EncryptionOutputStream
wraps an OutputStream
and produces
output bytes by applying a Encrypter
on each byte to be written
before delegating the processed vale to the given OutputStream
. The
output of the EncryptionOutputStream
can be converted back by the
according DecryptionInputStream
.-
Constructor Summary
ConstructorDescriptionEncryptionOutputStream
(OutputStream aOutputStream, Encrypter<byte[], byte[], EncryptionException> aEncrypter) Constructs theEncryptionOutputStream
by wrapping the givenOutputStream
for the providedEncrypter
to be applied on the bytes to be written. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
EncryptionOutputStream
public EncryptionOutputStream(OutputStream aOutputStream, Encrypter<byte[], byte[], EncryptionException> aEncrypter) Constructs theEncryptionOutputStream
by wrapping the givenOutputStream
for the providedEncrypter
to be applied on the bytes to be written.- Parameters:
aOutputStream
- TheOutputStream
to be wrapped.aEncrypter
- TheEncrypter
to be applied to the bytes to be written.
-
-
Method Details
-
equals
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
hashCode
public int hashCode() -
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
dispose
public void dispose()- Specified by:
dispose
in interfaceorg.refcodes.mixin.Disposable
-
toString
-