net.sf.ext.mediamanager.ebml
Class EBMLReader

java.lang.Object
  extended bynet.sf.ext.mediamanager.ebml.EBMLReader

public class EBMLReader
extends java.lang.Object

JEBML Intro


The following are the basic steps of how reading in JEBML works.


Reads EBML elements from a DataSource and looks them up in the provided DocType.

Author:
(c) 2002 John Cannon, (c) 2004 Jory Stone

Field Summary
protected  DocType doc
           
protected  ElementType elementTypes
           
protected  ElementType lastElementType
           
protected  DataSource source
           
 
Constructor Summary
EBMLReader(DataSource source, DocType doc)
          Creates a new EBMLReader reading from the DataSource source.
 
Method Summary
static long readEBMLCode(DataSource source)
          Reads an (Unsigned) EBML code from the DataSource and encodes it into a long.
static byte[] readEBMLCodeAsBytes(DataSource source)
          Reads an EBML code from the DataSource.
 Element readNextElement()
           
static long readSignedEBMLCode(DataSource source)
          Reads an Signed EBML code from the DataSource and encodes it into a long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected DataSource source

doc

protected DocType doc

elementTypes

protected ElementType elementTypes

lastElementType

protected ElementType lastElementType
Constructor Detail

EBMLReader

public EBMLReader(DataSource source,
                  DocType doc)
Creates a new EBMLReader reading from the DataSource source. The DocType doc is used to validate the document.

Parameters:
source - DataSource to read from
doc - DocType to use to validate the docment
Method Detail

readNextElement

public Element readNextElement()

readEBMLCode

public static long readEBMLCode(DataSource source)
Reads an (Unsigned) EBML code from the DataSource and encodes it into a long. This size should be cast into an int for actual use as Java only allows upto 32-bit file I/O operations.

Returns:
ebml size

readSignedEBMLCode

public static long readSignedEBMLCode(DataSource source)
Reads an Signed EBML code from the DataSource and encodes it into a long. This size should be cast into an int for actual use as Java only allows upto 32-bit file I/O operations.

Returns:
ebml size

readEBMLCodeAsBytes

public static byte[] readEBMLCodeAsBytes(DataSource source)
Reads an EBML code from the DataSource.

Returns:
byte array filled with the ebml size, (size bits included)