public class DirectFileReadDataSource
extends java.lang.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(java.io.File f) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.nio.ByteBuffer |
map(long startPosition,
long size) |
long |
position() |
void |
position(long nuPos) |
int |
read(java.nio.ByteBuffer byteBuffer) |
int |
readAllInOnce(java.nio.ByteBuffer byteBuffer) |
long |
size() |
long |
transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target) |
public DirectFileReadDataSource(java.io.File f)
throws java.io.IOException
java.io.IOExceptionpublic int read(java.nio.ByteBuffer byteBuffer)
throws java.io.IOException
read in interface com.googlecode.mp4parser.DataSourcejava.io.IOExceptionpublic int readAllInOnce(java.nio.ByteBuffer byteBuffer)
throws java.io.IOException
java.io.IOExceptionpublic long size()
throws java.io.IOException
size in interface com.googlecode.mp4parser.DataSourcejava.io.IOExceptionpublic long position()
throws java.io.IOException
position in interface com.googlecode.mp4parser.DataSourcejava.io.IOExceptionpublic void position(long nuPos)
throws java.io.IOException
position in interface com.googlecode.mp4parser.DataSourcejava.io.IOExceptionpublic long transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target)
throws java.io.IOException
transferTo in interface com.googlecode.mp4parser.DataSourcejava.io.IOExceptionpublic java.nio.ByteBuffer map(long startPosition,
long size)
throws java.io.IOException
map in interface com.googlecode.mp4parser.DataSourcejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface com.googlecode.mp4parser.DataSourceclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved