FileDocCategorySizeDatePackage
ProtectionSpecificHeader.javaAPI Docmp4parser 1.0-RC-172339Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.boxes.piff

ProtectionSpecificHeader

public class ProtectionSpecificHeader extends Object

Fields Summary
protected static Map
uuidRegistry
ByteBuffer
data
Constructors Summary
Methods Summary
public static com.googlecode.mp4parser.boxes.piff.ProtectionSpecificHeadercreateFor(java.util.UUID systemId, java.nio.ByteBuffer bufferWrapper)

        final Class<? extends ProtectionSpecificHeader> aClass = uuidRegistry.get(systemId);

        ProtectionSpecificHeader protectionSpecificHeader = new ProtectionSpecificHeader();
        if (aClass != null) {
            try {
                protectionSpecificHeader = aClass.newInstance();

            } catch (InstantiationException e) {
                throw new RuntimeException(e);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            }
        }
        protectionSpecificHeader.parse(bufferWrapper);
        return protectionSpecificHeader;

    
public booleanequals(java.lang.Object obj)


     
        uuidRegistry.put(UUID.fromString("9A04F079-9840-4286-AB92-E65BE0885F95"), PlayReadyHeader.class);
    
        if (obj instanceof ProtectionSpecificHeader) {
            if (this.getClass().equals(obj.getClass())) {
                return data.equals(((ProtectionSpecificHeader) obj).data);
            }
        }
        return false;
    
public java.nio.ByteBuffergetData()

        return data;
    
public voidparse(java.nio.ByteBuffer buffer)

        data = buffer;

    
public java.lang.StringtoString()

        final StringBuilder sb = new StringBuilder();
        sb.append("ProtectionSpecificHeader");
        sb.append("{data=");
        ByteBuffer data = getData().duplicate();
        data.rewind();
        byte[] bytes = new byte[data.limit()];
        data.get(bytes);
        sb.append(Hex.encodeHex(bytes));
        sb.append('}");
        return sb.toString();