![JAR search and dependency download from the Maven repository](/logo.png)
org.mp4parser.muxer.FileRandomAccessSourceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of muxer Show documentation
Show all versions of muxer Show documentation
This package has a focus on file operation. It can read A/V data from Random Access Datasources
package org.mp4parser.muxer;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import static org.mp4parser.tools.CastUtils.l2i;
public class FileRandomAccessSourceImpl implements RandomAccessSource {
private RandomAccessFile raf;
public FileRandomAccessSourceImpl(RandomAccessFile raf) {
this.raf = raf;
}
public ByteBuffer get(long offset, long size) throws IOException {
byte[] b = new byte[l2i(size)];
raf.seek(offset);
raf.read(b);
return ByteBuffer.wrap(b);
}
public void close() throws IOException {
raf.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy