public class FileBackedDataSource extends DataSource
DataSource backed by a File| Constructor and Description |
|---|
FileBackedDataSource(File file) |
FileBackedDataSource(FileChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying stream
|
void |
copyTo(OutputStream stream)
Copies the contents to the specified OutputStream
|
ByteBuffer |
read(int length,
long position) |
long |
size() |
void |
write(ByteBuffer src,
long position) |
public FileBackedDataSource(File file) throws FileNotFoundException
FileNotFoundExceptionpublic FileBackedDataSource(FileChannel channel)
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 © 2020. All rights reserved.