FileDocCategorySizeDatePackage
BaseDescriptor.javaAPI Docmp4parser 1.0-RC-172811Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.boxes.mp4.objectdescriptors

BaseDescriptor

public abstract class BaseDescriptor extends Object

Fields Summary
int
tag
int
sizeOfInstance
int
sizeBytes
Constructors Summary
public BaseDescriptor()

    
Methods Summary
public intgetSize()

        return sizeOfInstance
                + 1//1 for the tag
                + sizeBytes;
    
public intgetSizeBytes()

        return sizeBytes;
    
public intgetSizeOfInstance()

        return sizeOfInstance;
    
public intgetTag()

        return tag;
    
public final voidparse(int tag, java.nio.ByteBuffer bb)

        this.tag = tag;

        int i = 0;
        int tmp = IsoTypeReader.readUInt8(bb);
        i++;
        sizeOfInstance = tmp & 0x7f;
        while (tmp >>> 7 == 1) { //nextbyte indicator bit
            tmp = IsoTypeReader.readUInt8(bb);
            i++;
            //sizeOfInstance = sizeOfInstance<<7 | sizeByte;
            sizeOfInstance = sizeOfInstance << 7 | tmp & 0x7f;
        }
        sizeBytes = i;
        ByteBuffer detailSource = bb.slice();
        detailSource.limit(sizeOfInstance);
        parseDetail(detailSource);
        assert detailSource.remaining() == 0: this.getClass().getSimpleName() + " has not been fully parsed";
        bb.position(bb.position() + sizeOfInstance);
    
public abstract voidparseDetail(java.nio.ByteBuffer bb)

public java.lang.StringtoString()

        final StringBuilder sb = new StringBuilder();
        sb.append("BaseDescriptor");
        sb.append("{tag=").append(tag);
        sb.append(", sizeOfInstance=").append(sizeOfInstance);
        sb.append('}");
        return sb.toString();