DataSink.Factory| Constructor and Description |
|---|
AesCipherDataSink(byte[] secretKey,
DataSink wrappedDataSink)
Create an instance whose
write methods have the side effect of overwriting the input
data. |
AesCipherDataSink(byte[] secretKey,
DataSink wrappedDataSink,
byte[] scratch)
Create an instance whose
write methods are free of side effects. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the sink.
|
void |
open(DataSpec dataSpec)
Opens the sink to consume the specified data.
|
void |
write(byte[] data,
int offset,
int length)
Consumes the provided data.
|
public AesCipherDataSink(byte[] secretKey,
DataSink wrappedDataSink)
write methods have the side effect of overwriting the input
data. Use this constructor for maximum efficiency in the case that there is no
requirement for the input data arrays to remain unchanged.secretKey - The key data.wrappedDataSink - The wrapped DataSink.public AesCipherDataSink(byte[] secretKey,
DataSink wrappedDataSink,
byte[] scratch)
write methods are free of side effects. Use this constructor
when the input data arrays are required to remain unchanged.secretKey - The key data.wrappedDataSink - The wrapped DataSink.scratch - Scratch space. Data is decrypted into this array before being written to the
wrapped DataSink. It should be of appropriate size for the expected writes. If a
write is larger than the size of this array the write will still succeed, but multiple
cipher calls will be required to complete the operation.public void open(DataSpec dataSpec) throws java.io.IOException
DataSinkpublic void write(byte[] data,
int offset,
int length)
throws java.io.IOException
DataSink