org.jcodec.containers.mkv.ebml
Class Element

java.lang.Object
  extended by org.jcodec.containers.mkv.ebml.Element
Direct Known Subclasses:
BinaryElement, MasterElement

public class Element
extends Object

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

Author:
John Cannon

Field Summary
protected  ByteBuffer data
           
 long dataOffset
           
protected  boolean dataRead
           
 byte[] id
           
 long offset
           
protected  Element parent
           
 long size
           
 Type type
           
 
Constructor Summary
Element(byte[] type)
          Creates a new instance of Element
 
Method Summary
static byte[] ebmlBytes(long value)
           
static byte[] ebmlBytes(long val, int num)
           
static int getEbmlSize(long v)
           
 byte[] getId()
          Getter for property type.
 long getSize()
          Get the total size of this element
 boolean isSameEbmlId(byte[] typeId)
           
 boolean isSameMatroskaType(Type elemType)
           
 ByteBuffer mux()
           
 long mux(FileChannel os)
           
 void readData(FileChannel source)
          Read the element data
 void setParent(Element parent)
          Setter for property parent.
 void skipData(FileChannel source)
          Skip the element data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected Element parent

type

public Type type

id

public byte[] id

size

public long size

data

protected ByteBuffer data

dataRead

protected boolean dataRead

offset

public long offset

dataOffset

public long dataOffset
Constructor Detail

Element

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

Method Detail

readData

public void readData(FileChannel source)
              throws IOException
Read the element data

Throws:
IOException

skipData

public void skipData(FileChannel source)
              throws IOException
Skip the element data

Throws:
IOException

getSize

public long getSize()
Get the total size of this element


getId

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

Returns:
Value of property type.

setParent

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

Parameters:
parent - New value of property parent.

isSameEbmlId

public boolean isSameEbmlId(byte[] typeId)

isSameMatroskaType

public boolean isSameMatroskaType(Type elemType)

mux

public long mux(FileChannel os)
         throws IOException
Throws:
IOException

mux

public ByteBuffer mux()

ebmlBytes

public static byte[] ebmlBytes(long value)

ebmlBytes

public static byte[] ebmlBytes(long val,
                               int num)

getEbmlSize

public static int getEbmlSize(long v)


Copyright © 2013. All Rights Reserved.