public class DirectFileReadDataSource extends Object implements com.googlecode.mp4parser.DataSource
DataSource implementation that relies on direct reads from a RandomAccessFile.
It should be slower than FileDataSourceImpl but does not incur the implicit file locks of
memory mapped I/O on some JVMs. This implementation allows for a more controlled deletion of files
and might be preferred when working with temporary files.| Constructor and Description |
|---|
DirectFileReadDataSource(File f) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ByteBuffer |
map(long startPosition,
long size) |
long |
position() |
void |
position(long nuPos) |
int |
read(ByteBuffer byteBuffer) |
int |
readAllInOnce(ByteBuffer byteBuffer) |
long |
size() |
long |
transferTo(long position,
long count,
WritableByteChannel target) |
public DirectFileReadDataSource(File f) throws IOException
IOExceptionpublic int read(ByteBuffer byteBuffer) throws IOException
read in interface com.googlecode.mp4parser.DataSourceIOExceptionpublic int readAllInOnce(ByteBuffer byteBuffer) throws IOException
IOExceptionpublic long size()
throws IOException
size in interface com.googlecode.mp4parser.DataSourceIOExceptionpublic long position()
throws IOException
position in interface com.googlecode.mp4parser.DataSourceIOExceptionpublic void position(long nuPos)
throws IOException
position in interface com.googlecode.mp4parser.DataSourceIOExceptionpublic long transferTo(long position,
long count,
WritableByteChannel target)
throws IOException
transferTo in interface com.googlecode.mp4parser.DataSourceIOExceptionpublic ByteBuffer map(long startPosition, long size) throws IOException
map in interface com.googlecode.mp4parser.DataSourceIOExceptionpublic void close()
throws IOException
close in interface com.googlecode.mp4parser.DataSourceclose in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.