FileDocCategorySizeDatePackage
FileTypeBox.javaAPI Docmp4parser 1.0-RC-174381Wed Dec 19 20:10:38 GMT 2012com.coremedia.iso.boxes

FileTypeBox

public class FileTypeBox extends com.googlecode.mp4parser.AbstractBox
This box identifies the specifications to which this file complies.
Each brand is a printable four-character code, registered with ISO, that identifies a precise specification.

Fields Summary
public static final String
TYPE
private String
majorBrand
private long
minorVersion
private List
compatibleBrands
Constructors Summary
public FileTypeBox()


      
        super(TYPE);
    
public FileTypeBox(String majorBrand, long minorVersion, List compatibleBrands)

        super(TYPE);
        this.majorBrand = majorBrand;
        this.minorVersion = minorVersion;
        this.compatibleBrands = compatibleBrands;
    
Methods Summary
public void_parseDetails(java.nio.ByteBuffer content)

        majorBrand = IsoTypeReader.read4cc(content);
        minorVersion = IsoTypeReader.readUInt32(content);
        int compatibleBrandsCount = content.remaining() / 4;
        compatibleBrands = new LinkedList<String>();
        for (int i = 0; i < compatibleBrandsCount; i++) {
            compatibleBrands.add(IsoTypeReader.read4cc(content));
        }
    
public java.util.ListgetCompatibleBrands()
Gets an array of 4-cc brands.

return
the compatible brands

        return compatibleBrands;
    
protected voidgetContent(java.nio.ByteBuffer byteBuffer)

        byteBuffer.put(IsoFile.fourCCtoBytes(majorBrand));
        IsoTypeWriter.writeUInt32(byteBuffer, minorVersion);
        for (String compatibleBrand : compatibleBrands) {
            byteBuffer.put(IsoFile.fourCCtoBytes(compatibleBrand));
        }

    
protected longgetContentSize()

        return 8 + compatibleBrands.size() * 4;

    
public java.lang.StringgetMajorBrand()
Gets the brand identifier.

return
the brand identifier

        return majorBrand;
    
public longgetMinorVersion()
Gets an informative integer for the minor version of the major brand.

return
an informative integer
see
FileTypeBox#getMajorBrand()

        return minorVersion;
    
public voidsetCompatibleBrands(java.util.List compatibleBrands)

        this.compatibleBrands = compatibleBrands;
    
public voidsetMajorBrand(java.lang.String majorBrand)
Sets the major brand of the file used to determine an appropriate reader.

param
majorBrand the new major brand

        this.majorBrand = majorBrand;
    
public voidsetMinorVersion(int minorVersion)
Sets the "informative integer for the minor version of the major brand".

param
minorVersion the version number of the major brand

        this.minorVersion = minorVersion;
    
public java.lang.StringtoString()

        StringBuilder result = new StringBuilder();
        result.append("FileTypeBox[");
        result.append("majorBrand=").append(getMajorBrand());
        result.append(";");
        result.append("minorVersion=").append(getMinorVersion());
        for (String compatibleBrand : compatibleBrands) {
            result.append(";");
            result.append("compatibleBrand=").append(compatibleBrand);
        }
        result.append("]");
        return result.toString();