org.davic.mpeg.sections
Class Section

java.lang.Object
  extended byorg.davic.mpeg.sections.Section
All Implemented Interfaces:
java.lang.Cloneable

public class Section
extends java.lang.Object
implements java.lang.Cloneable

This class describes a single section as filtered from an MPEG transport stream. A cloned Section object is a new and separate object. It is unaffected by changes in the state of the original Section object or restarting of the SectionFilter the source Section object originated from. The clone method must be implemented without declaring exceptions.

Version:
updated to DAVIC 1.3.1

Method Summary
 java.lang.Object clone()
          Create a copy of this Section object.
 boolean current_next_indicator()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 byte getByteAt(int index)
          This method returns one byte from the filtered data.
 byte[] getData()
          This method returns all data from the filtered section in the Section object, including the section header.
 byte[] getData(int index, int length)
          This method returns the specified part of the filtered data.
 boolean getFullStatus()
          This method reads whether a Section object contains valid data.
 int last_section_number()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 boolean private_indicator()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 int section_length()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 int section_number()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 boolean section_syntax_indicator()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 void setEmpty()
          This method sets a Section object such that any data contained within it is no longer valid.
 int table_id_extension()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 int table_id()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 short version_number()
          This method returns the value of the corresponding field from an MPEG-2 section header.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getData

public byte[] getData()
               throws NoDataAvailableException
This method returns all data from the filtered section in the Section object, including the section header. Each call to this method results in a new a copy of the section data.

Throws:
NoDataAvailableException - if no valid data is available.

getData

public byte[] getData(int index,
                      int length)
               throws NoDataAvailableException,
                      java.lang.IndexOutOfBoundsException
This method returns the specified part of the filtered data. Each call to this method results in a new a copy of the section data.

Parameters:
index - defines within the filtered section the index of the first byte of the data to be retrieved. The first byte of the section (the table_id field) has index 1.
length - defines the number of consecutive bytes from the filtered section to be retrieved.
Throws:
NoDataAvailableException - if no valid data is available.
java.lang.IndexOutOfBoundsException - if any part of the filtered data requested would be outside the range of data in the section.

getByteAt

public byte getByteAt(int index)
               throws NoDataAvailableException,
                      java.lang.IndexOutOfBoundsException
This method returns one byte from the filtered data.

Parameters:
index - defines within the filtered section the index of the byte to be retrieved. The first byte of the section (the table_id field) has index 1.
Throws:
NoDataAvailableException - if no valid data is available.
java.lang.IndexOutOfBoundsException - if the byte requested would be outside the range of data in the section.

table_id

public int table_id()
             throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

section_syntax_indicator

public boolean section_syntax_indicator()
                                 throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

private_indicator

public boolean private_indicator()
                          throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

section_length

public int section_length()
                   throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

table_id_extension

public int table_id_extension()
                       throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

version_number

public short version_number()
                     throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

current_next_indicator

public boolean current_next_indicator()
                               throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

section_number

public int section_number()
                   throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

last_section_number

public int last_section_number()
                        throws NoDataAvailableException
This method returns the value of the corresponding field from an MPEG-2 section header.

Throws:
NoDataAvailableException - thrown if no valid data is available

getFullStatus

public boolean getFullStatus()
This method reads whether a Section object contains valid data.

Returns:
true when the Section object contains valid data otherwise false

setEmpty

public void setEmpty()
This method sets a Section object such that any data contained within it is no longer valid. This is intended to be used with RingSectionFilters to indicate that the particular object can be re-used.


clone

public java.lang.Object clone()
Create a copy of this Section object. A cloned Section object is a new and separate object. It is unaffected by changes in the state of the original Section object or restarting of the SectionFilter the source Section object originated from.