public abstract class DataSources
extends java.lang.Object
DataSource abstraction.| Modifier and Type | Method and Description |
|---|---|
static DataSource |
asDataSource(java.nio.ByteBuffer buffer)
Returns a
DataSource backed by the provided ByteBuffer. |
static DataSource |
asDataSource(java.nio.channels.FileChannel channel)
Returns a
DataSource backed by the provided FileChannel. |
static DataSource |
asDataSource(java.nio.channels.FileChannel channel,
long offset,
long size)
Returns a
DataSource backed by the provided region of the FileChannel. |
static DataSource |
asDataSource(java.io.RandomAccessFile file)
Returns a
DataSource backed by the provided RandomAccessFile. |
static DataSource |
asDataSource(java.io.RandomAccessFile file,
long offset,
long size)
Returns a
DataSource backed by the provided region of the RandomAccessFile. |
public static DataSource asDataSource(java.nio.ByteBuffer buffer)
DataSource backed by the provided ByteBuffer. The data source
represents the data contained between the position and limit of the buffer. Changes to the
buffer's contents will be visible in the data source.public static DataSource asDataSource(java.io.RandomAccessFile file)
DataSource backed by the provided RandomAccessFile. Changes to the
file, including changes to size of file, will be visible in the data source.public static DataSource asDataSource(java.io.RandomAccessFile file, long offset, long size)
DataSource backed by the provided region of the RandomAccessFile.
Changes to the file will be visible in the data source.public static DataSource asDataSource(java.nio.channels.FileChannel channel)
DataSource backed by the provided FileChannel. Changes to the
file, including changes to size of file, will be visible in the data source.public static DataSource asDataSource(java.nio.channels.FileChannel channel, long offset, long size)
DataSource backed by the provided region of the FileChannel.
Changes to the file will be visible in the data source.