org.dvb.si
Class Descriptor

java.lang.Object
  extended byorg.dvb.si.Descriptor

public class Descriptor
extends java.lang.Object

This class represents a descriptor within a sub-table.

A descriptor consist of three fields: a tag, a contentLength and the content.

The tag uniquely identifies the descriptor type. The content length indicates the number of bytes in the content. The content consists of an array of bytes of length content length. The data represented by the content is descriptor type dependent.

See Also:
DescriptorTag

Constructor Summary
protected Descriptor()
          This constructor is provided for the use of implementations and specifications which extend the present document.
 
Method Summary
 byte getByteAt(int index)
          Get a particular byte within the descriptor content
 byte[] getContent()
          Get a copy of the content of this descriptor (everything after the length field).
 short getContentLength()
          This method returns the length of the descriptor content as coded in the length field of this descriptor.
 short getTag()
          Get the descriptor tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Descriptor

protected Descriptor()
This constructor is provided for the use of implementations and specifications which extend the present document. Applications shall not define sub-classes of this class. Implementations are not required to behave correctly if any such application defined sub-classes are used.

Method Detail

getTag

public short getTag()
Get the descriptor tag. The value returned shall be the actual value used and is not limited to the values defined in DescriptorTag.

Returns:
The descriptor tag (the most common values are defined in the DescriptorTag interface)
See Also:
DescriptorTag

getContentLength

public short getContentLength()
This method returns the length of the descriptor content as coded in the length field of this descriptor.

Returns:
The length of the descriptor content.

getByteAt

public byte getByteAt(int index)
               throws java.lang.IndexOutOfBoundsException
Get a particular byte within the descriptor content

Parameters:
index - index to the descriptor content. Value 0 corresponds to the first byte after the length field.
Returns:
The required byte
Throws:
java.lang.IndexOutOfBoundsException - if index < 0 or index >= ContentLength

getContent

public byte[] getContent()
Get a copy of the content of this descriptor (everything after the length field).

Returns:
a copy of the content of the descriptor