net.sf.ext.mediamanager.ebml
Class Element

java.lang.Object
  extended bynet.sf.ext.mediamanager.ebml.Element
Direct Known Subclasses:
BinaryElement, MasterElement

public class Element
extends java.lang.Object

Defines the basic EBML element. Subclasses may provide child element access.

Author:
John Cannon

Field Summary
protected  byte[] data
           
protected  boolean dataRead
           
protected  Element parent
           
protected  long size
           
protected  byte[] type
           
protected  ElementType typeInfo
           
 
Constructor Summary
Element(byte[] type)
          Creates a new instance of Element
 
Method Summary
static int codedSizeLength(long value)
           
static int EBMLCodedSizeLength(long value)
           
static int EBMLSignedCodedSizeLength(long value)
           
 boolean equals(byte[] typeId)
           
 boolean equals(ElementType elemType)
           
 byte[] getData()
          Getter for property data.
 ElementType getElementType()
           
static int getMinByteSize(long value)
           
static int getMinByteSizeUnsigned(long value)
           
static int getMinSizeLength()
           
 Element getParent()
          Getter for property parent.
 long getSize()
          Getter for property size.
 byte[] getType()
          Getter for property type.
static byte[] makeEbmlCode(byte[] typeID, long size)
           
static byte[] makeEbmlCodedSize(long size)
           
static byte[] packInt(long value)
           
static byte[] packIntUnsigned(long value)
           
 void readData(DataSource source)
           
 void setData(byte[] data)
          Setter for property data.
 void setElementType(ElementType typeInfo)
           
static void setMinSizeLength(int minSize)
           
 void setParent(Element parent)
          Setter for property parent.
 void setSize(long size)
          Setter for property size.
 void setType(byte[] type)
          Setter for property type.
 void skipData(DataSource source)
           
 byte[] toByteArray()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected Element parent

typeInfo

protected ElementType typeInfo

type

protected byte[] type

size

protected long size

data

protected byte[] data

dataRead

protected boolean dataRead
Constructor Detail

Element

public Element(byte[] type)
Creates a new instance of Element

Method Detail

readData

public void readData(DataSource source)

skipData

public void skipData(DataSource source)

getData

public byte[] getData()
Getter for property data.

Returns:
Value of property data.

setData

public void setData(byte[] data)
Setter for property data.

Parameters:
data - New value of property data.

getSize

public long getSize()
Getter for property size.

Returns:
Value of property size.

setSize

public void setSize(long size)
Setter for property size.

Parameters:
size - New value of property size.

getType

public byte[] getType()
Getter for property type.

Returns:
Value of property type.

setType

public void setType(byte[] type)
Setter for property type.

Parameters:
type - New value of property type.

setElementType

public void setElementType(ElementType typeInfo)

getElementType

public ElementType getElementType()

getParent

public Element getParent()
Getter for property parent.

Returns:
Value of property parent.

setParent

public void setParent(Element parent)
Setter for property parent.

Parameters:
parent - New value of property parent.

toByteArray

public byte[] toByteArray()

equals

public boolean equals(byte[] typeId)

equals

public boolean equals(ElementType elemType)

setMinSizeLength

public static void setMinSizeLength(int minSize)

getMinSizeLength

public static int getMinSizeLength()

makeEbmlCode

public static byte[] makeEbmlCode(byte[] typeID,
                                  long size)

makeEbmlCodedSize

public static byte[] makeEbmlCodedSize(long size)

getMinByteSize

public static int getMinByteSize(long value)

getMinByteSizeUnsigned

public static int getMinByteSizeUnsigned(long value)

codedSizeLength

public static int codedSizeLength(long value)

EBMLCodedSizeLength

public static int EBMLCodedSizeLength(long value)

EBMLSignedCodedSizeLength

public static int EBMLSignedCodedSizeLength(long value)

packIntUnsigned

public static byte[] packIntUnsigned(long value)

packInt

public static byte[] packInt(long value)