edu.umd.cfar.lamp.mpeg1.system
Class SystemIndex
java.lang.Object
edu.umd.cfar.lamp.mpeg1.system.SystemIndex
- public class SystemIndex
- extends java.lang.Object
Method Summary |
void |
addPacket(int stream_id,
long systemStreamBytePosition,
int packetDataLength)
Adds a SystemIndexElement to the index. |
long |
getLastByteInPacket(int stream_id,
long bytePosition)
|
long |
getPosition(int stream_id,
long bytePosition)
Gets the byte position in the System Stream of the given byte
position in the elementary stream with the given
stream_id . |
java.util.Vector |
getStreamList()
|
java.util.Vector |
getVideoStreamList()
|
void |
readIndex(java.io.DataInput in)
|
java.lang.String |
toString()
|
void |
writeIndex(java.io.DataOutput out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MAGIC_NUMBER
public static final int MAGIC_NUMBER
- See Also:
- Constant Field Values
SystemIndex
public SystemIndex()
writeIndex
public void writeIndex(java.io.DataOutput out)
throws java.io.IOException
- Throws:
java.io.IOException
readIndex
public void readIndex(java.io.DataInput in)
throws java.io.IOException,
MpegException
- Throws:
java.io.IOException
MpegException
toString
public java.lang.String toString()
getStreamList
public java.util.Vector getStreamList()
- Returns:
- a
Vector
of Integer
s, corresponding to the list of stream_id
s.
getVideoStreamList
public java.util.Vector getVideoStreamList()
addPacket
public void addPacket(int stream_id,
long systemStreamBytePosition,
int packetDataLength)
- Adds a
SystemIndexElement
to the index. The
SystemIndexElement
is calculated based on the
stream_id
, the
systemStreamBytePosition
, and the index so far.
- Parameters:
stream_id
- the streamsystemStreamBytePosition
- the byte position into the system streampacketDataLength
- the length of the packet
getPosition
public long getPosition(int stream_id,
long bytePosition)
throws StreamNotFoundException
- Gets the byte position in the System Stream of the given byte
position in the elementary stream with the given
stream_id
.
- Parameters:
stream_id
- the streambytePosition
- the position into the stream
- Returns:
- the position in the file
- Throws:
StreamNotFoundException
getLastByteInPacket
public long getLastByteInPacket(int stream_id,
long bytePosition)
throws StreamNotFoundException
- Throws:
StreamNotFoundException