public interface DataSink
Modifier and Type | Interface and Description |
---|---|
static interface |
DataSink.Factory
A factory for
DataSink instances. |
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[] buffer,
int offset,
int length)
Consumes the provided data.
|
void open(DataSpec dataSpec) throws java.io.IOException
dataSpec
- Defines the data to be consumed.java.io.IOException
- If an error occurs opening the sink.void write(byte[] buffer, int offset, int length) throws java.io.IOException
buffer
- 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.java.io.IOException
- If an error occurs writing to the sink.void close() throws java.io.IOException
java.io.IOException
- If an error occurs closing the sink.