| Constructor and Description |
|---|
ByteArrayDataSink() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
DataSink. |
byte[] |
getData()
Returns the data written to the sink since the last call to
open(DataSpec). |
DataSink |
open(DataSpec dataSpec)
Opens the
DataSink to consume the specified data. |
void |
write(byte[] buffer,
int offset,
int length)
Consumes the provided data.
|
public DataSink open(DataSpec dataSpec) throws IOException
DataSinkDataSink to consume the specified data. Calls to DataSink.open(DataSpec) and
DataSink.close() must be balanced.open in interface DataSinkdataSpec - Defines the data to be consumed.DataSink, for convenience.IOExceptionpublic void close()
throws IOException
DataSinkDataSink.close in interface DataSinkIOExceptionpublic void write(byte[] buffer,
int offset,
int length)
throws IOException
DataSinkwrite in interface DataSinkbuffer - The buffer from which data should be consumed.offset - The offset of the data to consume in buffer.length - The length of the data to consume, in bytes.IOExceptionpublic byte[] getData()
open(DataSpec).open(DataSpec) has never been called.