public class FileBackedDataSource extends DataSource
DataSource backed by a File| Constructor and Description |
|---|
FileBackedDataSource(File file) |
FileBackedDataSource(File file,
boolean readOnly) |
FileBackedDataSource(FileChannel channel,
boolean readOnly) |
FileBackedDataSource(RandomAccessFile srcFile,
boolean readOnly) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying stream
|
void |
copyTo(OutputStream stream)
Copies the contents to the specified OutputStream
|
FileChannel |
getChannel() |
boolean |
isWriteable() |
ByteBuffer |
read(int length,
long position) |
long |
size() |
void |
write(ByteBuffer src,
long position) |
public FileBackedDataSource(File file) throws FileNotFoundException
FileNotFoundExceptionpublic FileBackedDataSource(File file, boolean readOnly) throws FileNotFoundException
FileNotFoundExceptionpublic FileBackedDataSource(RandomAccessFile srcFile, boolean readOnly)
public FileBackedDataSource(FileChannel channel, boolean readOnly)
public boolean isWriteable()
public FileChannel getChannel()
public ByteBuffer read(int length, long position) throws IOException
read in class DataSourceIOExceptionpublic void write(ByteBuffer src, long position) throws IOException
write in class DataSourceIOExceptionpublic void copyTo(OutputStream stream) throws IOException
DataSourcecopyTo in class DataSourceIOExceptionpublic long size()
throws IOException
size in class DataSourceIOExceptionpublic void close()
throws IOException
DataSourceclose in class DataSourceIOExceptionCopyright © 2007-2022. All Rights Reserved.