Java DTV API 1.3
18-Nov-2009

com.sun.dtv.filtering
Class DataSection

java.lang.Object
  extended by com.sun.dtv.filtering.DataSection
All Implemented Interfaces:
Cloneable

public class DataSection
extends Object
implements Cloneable

This class encapsulates a Transport Stream data section

This object is cloneable. Modifying a cloned object in no way affect the original object. Additionally, access to raw section data is also provided through a copy mechanism. Editing such data will not affect any Section object's internal data nor will it affect the contents of a transport or elementary stream.


Method Summary
 Object clone()
          Create a copy of this DataSection object.
 boolean getAvailable()
          Retrieve whether a DataSection object contains valid data.
 boolean getCurrentNextIndicator()
          Retrieve the value of the corresponding field from a data section header.
 int getLastSectionNumber()
          Retrieve the value of the corresponding field from a data section header.
 boolean getPrivateIndicator()
          Retrieve the value of the corresponding field from a data section header.
 byte getSectionByte(int index)
          Retrieve a single data byte at the provided index from the filtered section.
 DataSectionDataBuffer getSectionData()
          Retrieve the data from the filtered section in the DataSection object.
 DataSectionDataBuffer getSectionData(int index, int length)
          Retrieve data from the filtered section using the provided index and length.
 int getSectionLength()
          Retrieve the value of the corresponding field from a data section header.
 int getSectionNumber()
          Retrieve the value of the corresponding field from a data section header.
 boolean getSectionSyntaxIndicator()
          Retrieve the value of the corresponding field from a data section header.
 int getTableId()
          Retrieve the value of the corresponding field from an data section header.
 int getTableIdExtension()
          Retrieve the value of the corresponding field from a data section header.
 short getVersionNumber()
          Retrieve the value of the corresponding field from a data section header.
 void release()
          This method marks section data object for use because the data is no longer useful or it has been cloned.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSectionData

public DataSectionDataBuffer getSectionData()
                                     throws DataUnavailableException
Retrieve the data from the filtered section in the DataSection object. A new copy of the section data will be created for each call (i.e. everything after the length field, including the section header and not including a CRC check).

Returns:
A DataSectionDataBuffer containing the requested data
Throws:
DataUnavailableException - if no valid data is available.

getSectionData

public DataSectionDataBuffer getSectionData(int index,
                                            int length)
                                     throws DataUnavailableException,
                                            IndexOutOfBoundsException
Retrieve data from the filtered section using the provided index and length. A new copy of the section data will be created for each call (i.e. everything after the length field, not including a CRC check).

Parameters:
index - start index (the first byte of section (the table_id field) has index 1)
length - the length
Returns:
A DataSectionDataBuffer containing the requested data
Throws:
DataUnavailableException - if no valid data is available.
IndexOutOfBoundsException - if the requested data is not in the range of data in the section.

getSectionByte

public byte getSectionByte(int index)
                    throws DataUnavailableException,
                           IndexOutOfBoundsException
Retrieve a single data byte at the provided index from the filtered section.

Parameters:
index - the index (the first byte of section (the table_id field) has index 1)
Returns:
the byte value at the specified index of section data
Throws:
DataUnavailableException - if no valid data is available.
IndexOutOfBoundsException - if the requested data is not in the range of data in the section.

getTableId

public int getTableId()
Retrieve the value of the corresponding field from an data section header.

Note: No exceptions are thrown as this field should ALWAYS be available.

Returns:
the table_id value

getSectionSyntaxIndicator

public boolean getSectionSyntaxIndicator()
Retrieve the value of the corresponding field from a data section header.

Note: No exceptions are thrown as this field should ALWAYS be available.

Returns:
whether the section syntax indicator is set in the section data

getPrivateIndicator

public boolean getPrivateIndicator()
Retrieve the value of the corresponding field from a data section header.

Note: No exceptions are thrown as this field should ALWAYS be available.

Returns:
whether the private indicator flag is set in the section data

getSectionLength

public int getSectionLength()
Retrieve the value of the corresponding field from a data section header.

Note: No exceptions are thrown as this field should ALWAYS be available.

Returns:
the section length field

getTableIdExtension

public int getTableIdExtension()
                        throws DataUnavailableException
Retrieve the value of the corresponding field from a data section header.

Returns:
the table_id_extension field
Throws:
DataUnavailableException - if no valid data is available.

getVersionNumber

public short getVersionNumber()
                       throws DataUnavailableException
Retrieve the value of the corresponding field from a data section header.

Returns:
the version number field
Throws:
DataUnavailableException - if no valid data is available.

getCurrentNextIndicator

public boolean getCurrentNextIndicator()
                                throws DataUnavailableException
Retrieve the value of the corresponding field from a data section header.

Returns:
whether the current_next_indicator flag is set in the section data
Throws:
DataUnavailableException - if no valid data is available.

getSectionNumber

public int getSectionNumber()
                     throws DataUnavailableException
Retrieve the value of the corresponding field from a data section header.

Returns:
the section number
Throws:
DataUnavailableException - if no valid data is available.

getLastSectionNumber

public int getLastSectionNumber()
                         throws DataUnavailableException
Retrieve the value of the corresponding field from a data section header.

Returns:
the last_section_number field
Throws:
DataUnavailableException - if no valid data is available.

getAvailable

public boolean getAvailable()
Retrieve whether a DataSection object contains valid data.

Returns:
whether the section data is valid and available for reading

release

public void release()
This method marks section data object for use because the data is no longer useful or it has been cloned. This allows RingFilter objects to re-use the section data object for a subsequent filter match.


clone

public Object clone()
Create a copy of this DataSection object. Any modifications to this copied object will not affect the original object that has been cloned.

Overrides:
clone in class Object
Returns:
The cloned object

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.