public class OggPacketReader extends Object
Constructor and Description |
---|
OggPacketReader(InputStream inp) |
Modifier and Type | Method and Description |
---|---|
OggPacket |
getNextPacket()
Returns the next packet in the file, or
null if no more packets remain.
|
OggPacket |
getNextPacketWithSid(int sid)
Returns the next packet with the given SID (Stream ID), or
null if no more packets remain.
|
void |
skipToGranulePosition(int sid,
long granulePosition)
Skips forward until the first packet with a Granule Position
of equal or greater than that specified.
|
void |
skipToSequenceNumber(int sid,
int sequenceNumber)
Skips forward until the first packet with a Sequence Number
of equal or greater than that specified.
|
void |
unreadPacket(OggPacket packet)
Un-reads a packet, leaving it ready to be feteched by the
next call to
getNextPacket() . |
public OggPacketReader(InputStream inp)
public OggPacket getNextPacket() throws IOException
OggPacket.isBeginningOfStream()
to detect if it is the first packet in the
stream or not, and use
OggPacket.getSid()
to track which
stream it belongs to.IOException
public OggPacket getNextPacketWithSid(int sid) throws IOException
IOException
public void unreadPacket(OggPacket packet)
getNextPacket()
.
Only one packet may be unread.
Normally used when identifying a stream, to leave the
initial packet ready for a decoderpublic void skipToSequenceNumber(int sid, int sequenceNumber) throws IOException
getNextPacket()
to retrieve this packet.
This method advances across all streams, but only searches the
specified one.sid
- The ID of the stream who's packets we will searchsequenceNumber
- The sequence number we're looking forIOException
public void skipToGranulePosition(int sid, long granulePosition) throws IOException
getNextPacket()
to retrieve this packet.
This method advances across all streams, but only searches the
specified one.sid
- The ID of the stream who's packets we will searchgranulePosition
- The granule position we're looking forIOException
Copyright © 2015. All rights reserved.