public class FileBackedDataSource extends DataSource
DataSource backed by a File| Constructor and Description |
|---|
FileBackedDataSource(java.io.File file) |
FileBackedDataSource(java.nio.channels.FileChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying stream
|
void |
copyTo(java.io.OutputStream stream)
Copies the contents to the specified OutputStream
|
java.nio.ByteBuffer |
read(int length,
long position) |
long |
size() |
void |
write(java.nio.ByteBuffer src,
long position) |
public FileBackedDataSource(java.io.File file)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic FileBackedDataSource(java.nio.channels.FileChannel channel)
public java.nio.ByteBuffer read(int length,
long position)
throws java.io.IOException
read in class DataSourcejava.io.IOExceptionpublic void write(java.nio.ByteBuffer src,
long position)
throws java.io.IOException
write in class DataSourcejava.io.IOExceptionpublic void copyTo(java.io.OutputStream stream)
throws java.io.IOException
DataSourcecopyTo in class DataSourcejava.io.IOExceptionpublic long size()
throws java.io.IOException
size in class DataSourcejava.io.IOExceptionpublic void close()
throws java.io.IOException
DataSourceclose in class DataSourcejava.io.IOExceptionCopyright 2014 The Apache Software Foundation or its licensors, as applicable.