Methods Summary |
---|
public void | addAndReplace(Box box)
data.position(l2i(box.getSize()));
data = data.slice();
replacers.add(box);
|
public void | getBox(java.nio.channels.WritableByteChannel os)
for (Box replacer : replacers) {
replacer.getBox(os);
}
ByteBuffer header = ByteBuffer.allocate(8);
IsoTypeWriter.writeUInt32(header, 8 + data.limit());
header.put(TYPE.getBytes());
header.rewind();
os.write(header);
data.rewind();
os.write(data);
|
public java.nio.ByteBuffer | getData()
return data;
|
public ContainerBox | getParent()
return parent;
|
public long | getSize()
long size = 8;
for (Box replacer : replacers) {
size += replacer.getSize();
}
size += data.limit();
return size;
|
public java.lang.String | getType()
return TYPE;
|
public void | parse(java.nio.channels.ReadableByteChannel readableByteChannel, java.nio.ByteBuffer header, long contentSize, com.coremedia.iso.BoxParser boxParser)
if (readableByteChannel instanceof FileChannel && contentSize > 1024 * 1024) {
// It's quite expensive to map a file into the memory. Just do it when the box is larger than a MB.
data = ((FileChannel) readableByteChannel).map(FileChannel.MapMode.READ_ONLY, ((FileChannel) readableByteChannel).position(), contentSize);
((FileChannel) readableByteChannel).position(((FileChannel) readableByteChannel).position() + contentSize);
} else {
assert contentSize < Integer.MAX_VALUE;
data = ChannelHelper.readFully(readableByteChannel, contentSize);
}
|
public void | setData(java.nio.ByteBuffer data)
this.data = data;
|
public void | setParent(ContainerBox parent)
this.parent = parent;
|