public abstract class DataSinks
extends java.lang.Object
DataSink abstraction.| Modifier and Type | Method and Description |
|---|---|
static DataSink |
asDataSink(java.security.MessageDigest... digests)
Returns a
DataSink which forwards data into the provided MessageDigest
instances via their update method. |
static DataSink |
asDataSink(java.io.OutputStream out)
Returns a
DataSink which outputs received data into the provided
OutputStream. |
static DataSink |
asDataSink(java.io.RandomAccessFile file)
Returns a
DataSink which outputs received data into the provided file, sequentially,
starting at the beginning of the file. |
static ReadableDataSink |
newInMemoryDataSink()
Returns a new in-memory
DataSink which exposes all data consumed so far via the
DataSource interface. |
static ReadableDataSink |
newInMemoryDataSink(int initialCapacity)
Returns a new in-memory
DataSink which exposes all data consumed so far via the
DataSource interface. |
public static DataSink asDataSink(java.io.OutputStream out)
DataSink which outputs received data into the provided
OutputStream.public static DataSink asDataSink(java.io.RandomAccessFile file)
DataSink which outputs received data into the provided file, sequentially,
starting at the beginning of the file.public static DataSink asDataSink(java.security.MessageDigest... digests)
DataSink which forwards data into the provided MessageDigest
instances via their update method. Each MessageDigest instance receives the
same data.public static ReadableDataSink newInMemoryDataSink()
DataSink which exposes all data consumed so far via the
DataSource interface.public static ReadableDataSink newInMemoryDataSink(int initialCapacity)
DataSink which exposes all data consumed so far via the
DataSource interface.initialCapacity - initial capacity in bytes