public class CryptoSinkWriter<T> extends java.lang.Object implements SinkWriter<T,java.io.OutputStream>
SinkWriter w
to encrypt whatever w writes to the sink OutputStream.| Constructor and Description |
|---|
CryptoSinkWriter(CipherFactory crypto,
SinkWriter<T,java.io.OutputStream> writer)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
write(java.io.OutputStream sink,
T value)
Writes a value to a data sink.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waituncheckedWritepublic CryptoSinkWriter(CipherFactory crypto, SinkWriter<T,java.io.OutputStream> writer)
crypto - factory to create encryption ciphers.writer - the underlying writer that actually outputs the
T-value to the sink OutputStream.java.lang.NullPointerException - if any argument is null.public void write(java.io.OutputStream sink,
T value)
throws java.lang.Exception
SinkWriterwrite in interface SinkWriter<T,java.io.OutputStream>sink - where to write the value to.value - the data to write.java.lang.NullPointerException - if any of the arguments is null.java.lang.Exception - if the data could not be written to the sink.