com.coremedia.iso.boxes.odf
Class OmaDrmCommonHeadersBox

java.lang.Object
  extended by com.coremedia.iso.boxes.AbstractBox
      extended by com.coremedia.iso.boxes.AbstractFullBox
          extended by com.coremedia.iso.boxes.odf.OmaDrmCommonHeadersBox
All Implemented Interfaces:
Box, ContainerBox, FullBox

public class OmaDrmCommonHeadersBox
extends AbstractFullBox
implements ContainerBox

The Common Headers Box defines a structure for required headers in a DCF file. See OMA-TS-DRM-DCF-V2_0-* specification for details.


Field Summary
static String TYPE
           
 
Fields inherited from class com.coremedia.iso.boxes.AbstractBox
offset, parsed
 
Constructor Summary
OmaDrmCommonHeadersBox()
           
 
Method Summary
 List<Box> getBoxes()
          Gets all child boxes.
<T extends Box>
List<T>
getBoxes(Class<T> clazz)
          Gets all child boxes of the given type.
<T extends Box>
List<T>
getBoxes(Class<T> clazz, boolean recursive)
          Gets all child boxes of the given type.
protected  void getContent(IsoOutputStream isos)
          Writes the box's content into the given IsoOutputStream.
 String getContentId()
           
protected  long getContentSize()
          Gets the box's content size without header size where header includes flags and version.
 String getDisplayName()
          Returns the human readable name of the box.
 int getEncryptionMethod()
           
 long getNumOfBytesToFirstChild()
          Returns the number of bytes from the start of the box to start of the first child.
 int getPaddingScheme()
           
 long getPlaintextLength()
           
 String getRightsIssuerUrl()
           
 String getTextualHeaders()
           
 void parse(IsoBufferWrapper in, long size, BoxParser boxParser, Box lastMovieFragmentBox)
          Pareses the given IsoBufferWrapper and returns the remaining bytes.
 void setBoxes(List<Box> extendedHeaders)
          Sets all boxes and removes all previous child boxes.
 void setContentId(String contentId)
           
 void setEncryptionMethod(int encryptionMethod)
           
 void setPaddingScheme(int paddingScheme)
           
 void setPlaintextLength(long plaintextLength)
           
 void setRightsIssuerUrl(String rightsIssuerUrl)
           
 void setTextualHeaders(Map<String,String> m)
           
 String toString()
           
 
Methods inherited from class com.coremedia.iso.boxes.AbstractFullBox
getFlags, getHeader, getHeaderSize, getVersion, parseHeader, setFlags, setVersion
 
Methods inherited from class com.coremedia.iso.boxes.AbstractBox
addWriteListener, calculateOffset, getBox, getDeadBytes, getIsoFile, getOffset, getParent, getSize, getType, getUserType, isParsed, setDeadBytes, setParent, setParsed, setUserType, utf8StringLengthInBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.coremedia.iso.boxes.ContainerBox
getIsoFile, getParent
 
Methods inherited from interface com.coremedia.iso.boxes.Box
calculateOffset, getBox, getOffset, getSize, getType, getUserType, isParsed
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values
Constructor Detail

OmaDrmCommonHeadersBox

public OmaDrmCommonHeadersBox()
Method Detail

getBoxes

public <T extends Box> List<T> getBoxes(Class<T> clazz)
Description copied from interface: ContainerBox
Gets all child boxes of the given type. May not return null.

Specified by:
getBoxes in interface ContainerBox
Parameters:
clazz - child box's type
Returns:
an array of boxes, empty array in case of no children.

getBoxes

public <T extends Box> List<T> getBoxes(Class<T> clazz,
                                        boolean recursive)
Description copied from interface: ContainerBox
Gets all child boxes of the given type. May not return null.

Specified by:
getBoxes in interface ContainerBox
Parameters:
clazz - child box's type
recursive - step down the tree
Returns:
an array of boxes, empty array in case of no children.

getBoxes

public List<Box> getBoxes()
Description copied from interface: ContainerBox
Gets all child boxes. May not return null.

Specified by:
getBoxes in interface ContainerBox
Returns:
an array of boxes, empty array in case of no children.

setTextualHeaders

public void setTextualHeaders(Map<String,String> m)

setRightsIssuerUrl

public void setRightsIssuerUrl(String rightsIssuerUrl)

setContentId

public void setContentId(String contentId)

setPlaintextLength

public void setPlaintextLength(long plaintextLength)

setPaddingScheme

public void setPaddingScheme(int paddingScheme)

setEncryptionMethod

public void setEncryptionMethod(int encryptionMethod)

getEncryptionMethod

public int getEncryptionMethod()

getPaddingScheme

public int getPaddingScheme()

getPlaintextLength

public long getPlaintextLength()

getContentId

public String getContentId()

getRightsIssuerUrl

public String getRightsIssuerUrl()

getTextualHeaders

public String getTextualHeaders()

getDisplayName

public String getDisplayName()
Description copied from class: AbstractBox
Returns the human readable name of the box.

Specified by:
getDisplayName in class AbstractBox
Returns:
a display string

getContentSize

protected long getContentSize()
Description copied from class: AbstractFullBox
Gets the box's content size without header size where header includes flags and version.

Specified by:
getContentSize in class AbstractFullBox
Returns:
Gets the box's content size

parse

public void parse(IsoBufferWrapper in,
                  long size,
                  BoxParser boxParser,
                  Box lastMovieFragmentBox)
           throws IOException
Description copied from class: AbstractBox
Pareses the given IsoBufferWrapper and returns the remaining bytes.

Overrides:
parse in class AbstractFullBox
Parameters:
in - the (part of the) iso file to parse
size - expected size of the box
boxParser - creates inner boxes
lastMovieFragmentBox - latest of previously found moof boxes
Throws:
IOException - in case of an I/O error.

getContent

protected void getContent(IsoOutputStream isos)
                   throws IOException
Description copied from class: AbstractBox
Writes the box's content into the given IsoOutputStream. This MUST NOT include any header bytes.

Specified by:
getContent in class AbstractBox
Parameters:
isos - the box's content-sink.
Throws:
IOException - in case of an exception in the underlying OutputStream.

toString

public String toString()
Overrides:
toString in class Object

setBoxes

public void setBoxes(List<Box> extendedHeaders)
Description copied from interface: ContainerBox
Sets all boxes and removes all previous child boxes.

Specified by:
setBoxes in interface ContainerBox
Parameters:
extendedHeaders - the new list of children

getNumOfBytesToFirstChild

public long getNumOfBytesToFirstChild()
Description copied from interface: ContainerBox
Returns the number of bytes from the start of the box to start of the first child.

Specified by:
getNumOfBytesToFirstChild in interface ContainerBox
Returns:
offset of first child from box start


Copyright © 2011. All Rights Reserved.