1 /* 2 * Copyright 2011 castLabs, Berlin 3 * 4 * Licensed under the Apache License, Version 2.0 (the License); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an AS IS BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.googlecode.mp4parser.boxes.mp4.objectdescriptors; 18 19 import com.coremedia.iso.Hex; 20 21 import java.io.IOException; 22 import java.nio.ByteBuffer; 23 24 /** 25 * abstract class ExtensionDescriptor extends BaseDescriptor 26 * : bit(8) tag = ExtensionProfileLevelDescrTag, ExtDescrTagStartRange .. 27 * ExtDescrTagEndRange { 28 * // empty. To be filled by classes extending this class. 29 * } 30 */ 31 @Descriptor(tags = {0x13}) 32 public class ExtensionProfileLevelDescriptor extends BaseDescriptor { 33 byte[] bytes; 34 35 @Override parseDetail(ByteBuffer bb)36 public void parseDetail(ByteBuffer bb) throws IOException { 37 if (getSize() > 0) { 38 bytes = new byte[getSize()]; 39 bb.get(bytes); 40 } 41 } 42 43 @Override toString()44 public String toString() { 45 final StringBuilder sb = new StringBuilder(); 46 sb.append("ExtensionDescriptor"); 47 sb.append("{bytes=").append(bytes == null ? "null" : Hex.encodeHex(bytes)); 48 sb.append('}'); 49 return sb.toString(); 50 } 51 } 52