All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mp4parser.boxes.iso14496.part12.ChunkOffset64BitBox Maven / Gradle / Ivy

Go to download

A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)

The newest version!
package org.mp4parser.boxes.iso14496.part12;

import org.mp4parser.tools.CastUtils;
import org.mp4parser.tools.IsoTypeReader;
import org.mp4parser.tools.IsoTypeWriter;

import java.nio.ByteBuffer;

/**
 * 

4cc = "{@value #TYPE}"

* Abstract Chunk Offset Box */ public class ChunkOffset64BitBox extends ChunkOffsetBox { public static final String TYPE = "co64"; private long[] chunkOffsets; public ChunkOffset64BitBox() { super(TYPE); } @Override public long[] getChunkOffsets() { return chunkOffsets; } @Override public void setChunkOffsets(long[] chunkOffsets) { this.chunkOffsets = chunkOffsets; } @Override protected long getContentSize() { return 8 + 8 * chunkOffsets.length; } @Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); int entryCount = CastUtils.l2i(IsoTypeReader.readUInt32(content)); chunkOffsets = new long[entryCount]; for (int i = 0; i < entryCount; i++) { chunkOffsets[i] = IsoTypeReader.readUInt64(content); } } @Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); IsoTypeWriter.writeUInt32(byteBuffer, chunkOffsets.length); for (long chunkOffset : chunkOffsets) { IsoTypeWriter.writeUInt64(byteBuffer, chunkOffset); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy