public class DirectFileReadDataSource
extends java.lang.Object
DataSource
implementation that relies on direct reads from a RandomAccessFile
.
It should be slower than com.googlecode.mp4parser.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.IOException
public int read(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
java.io.IOException
public int readAllInOnce(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
java.io.IOException
public long size() throws java.io.IOException
java.io.IOException
public long position() throws java.io.IOException
java.io.IOException
public void position(long nuPos) throws java.io.IOException
java.io.IOException
public long transferTo(long position, long count, java.nio.channels.WritableByteChannel target) throws java.io.IOException
java.io.IOException
public java.nio.ByteBuffer map(long startPosition, long size) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"