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.IOException
public int read(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
read
in interface com.googlecode.mp4parser.DataSource
java.io.IOException
public int readAllInOnce(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
java.io.IOException
public long size() throws java.io.IOException
size
in interface com.googlecode.mp4parser.DataSource
java.io.IOException
public long position() throws java.io.IOException
position
in interface com.googlecode.mp4parser.DataSource
java.io.IOException
public void position(long nuPos) throws java.io.IOException
position
in interface com.googlecode.mp4parser.DataSource
java.io.IOException
public long transferTo(long position, long count, java.nio.channels.WritableByteChannel target) throws java.io.IOException
transferTo
in interface com.googlecode.mp4parser.DataSource
java.io.IOException
public java.nio.ByteBuffer map(long startPosition, long size) throws java.io.IOException
map
in interface com.googlecode.mp4parser.DataSource
java.io.IOException
public void close() throws java.io.IOException
close
in interface com.googlecode.mp4parser.DataSource
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © 2010 - 2020 Adobe. All Rights Reserved