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

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

Go to download

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

There is a newer version: 1.9.56
Show newest version
package org.mp4parser.boxes.iso14496.part12;

import org.mp4parser.support.AbstractFullBox;
import org.mp4parser.tools.IsoTypeReader;
import org.mp4parser.tools.Utf8;

import java.nio.ByteBuffer;

/**
 * 

4cc = "{@value #TYPE}"

*/ public class XmlBox extends AbstractFullBox { public static final String TYPE = "xml "; String xml = ""; public XmlBox() { super(TYPE); } public String getXml() { return xml; } public void setXml(String xml) { this.xml = xml; } @Override protected long getContentSize() { return 4 + Utf8.utf8StringLengthInBytes(xml); } @Override public void _parseDetails(ByteBuffer content) { parseVersionAndFlags(content); xml = IsoTypeReader.readString(content, content.remaining()); } @Override protected void getContent(ByteBuffer byteBuffer) { writeVersionAndFlags(byteBuffer); byteBuffer.put(Utf8.convert(xml)); } @Override public String toString() { return "XmlBox{" + "xml='" + xml + '\'' + '}'; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy