de.jarnbjo.ogg
Class LogicalOggStreamImpl
java.lang.Object
de.jarnbjo.ogg.LogicalOggStreamImpl
- All Implemented Interfaces:
- LogicalOggStream
public class LogicalOggStreamImpl
- extends Object
- implements LogicalOggStream
|
Method Summary |
void |
addGranulePosition(long granulePosition)
|
void |
addPageNumberMapping(int physicalPageNumber)
|
void |
checkFormat(OggPage page)
|
void |
close()
Closes this stream. |
String |
getFormat()
|
long |
getMaximumGranulePosition()
This method does not work if the physical Ogg stream is not
seekable. |
byte[] |
getNextOggPacket()
Note: To read from the stream, you must use either
this method or the method getNextOggPage. |
OggPage |
getNextOggPage()
Note: To read from the stream, you must use either
this method or the method getNextOggPacket. |
long |
getTime()
|
boolean |
isOpen()
Checks if this stream is open for reading. |
void |
reset()
Sets the stream's position to the beginning of the stream. |
void |
setTime(long granulePosition)
This method is invoked on all logical streams when
calling the same method on the physical stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LogicalOggStreamImpl
public LogicalOggStreamImpl(PhysicalOggStream source,
int serialNumber)
addPageNumberMapping
public void addPageNumberMapping(int physicalPageNumber)
addGranulePosition
public void addGranulePosition(long granulePosition)
reset
public void reset()
throws OggFormatException,
IOException
- Description copied from interface:
LogicalOggStream
- Sets the stream's position to the beginning of the stream.
This method does not work if the physical Ogg stream is not
seekable.
- Specified by:
reset in interface LogicalOggStream
- Throws:
OggFormatException - if the ogg stream is corrupted
IOException - if some other IO error occurs
getNextOggPage
public OggPage getNextOggPage()
throws EndOfOggStreamException,
OggFormatException,
IOException
- Description copied from interface:
LogicalOggStream
- Note: To read from the stream, you must use either
this method or the method
getNextOggPacket.
Mixing calls to the two methods will cause data corruption.
- Specified by:
getNextOggPage in interface LogicalOggStream
- Returns:
- the next Ogg page
- Throws:
OggFormatException - if the ogg stream is corrupted
IOException - if some other IO error occurs
EndOfOggStreamException- See Also:
LogicalOggStream.getNextOggPacket()
getNextOggPacket
public byte[] getNextOggPacket()
throws EndOfOggStreamException,
OggFormatException,
IOException
- Description copied from interface:
LogicalOggStream
- Note: To read from the stream, you must use either
this method or the method
getNextOggPage.
Mixing calls to the two methods will cause data corruption.
- Specified by:
getNextOggPacket in interface LogicalOggStream
- Returns:
- the next packet as a byte array
- Throws:
OggFormatException - if the ogg stream is corrupted
IOException - if some other IO error occurs
EndOfOggStreamException- See Also:
LogicalOggStream.getNextOggPage()
isOpen
public boolean isOpen()
- Description copied from interface:
LogicalOggStream
- Checks if this stream is open for reading.
- Specified by:
isOpen in interface LogicalOggStream
- Returns:
true if this stream is open for reading,
false otherwise
close
public void close()
throws IOException
- Description copied from interface:
LogicalOggStream
- Closes this stream. After invoking this method, no further access
to the streams data is possible.
- Specified by:
close in interface LogicalOggStream
- Throws:
IOException - if an IO error occurs
getMaximumGranulePosition
public long getMaximumGranulePosition()
- Description copied from interface:
LogicalOggStream
- This method does not work if the physical Ogg stream is not
seekable.
- Specified by:
getMaximumGranulePosition in interface LogicalOggStream
- Returns:
- the granule position of the last page within
this stream
getTime
public long getTime()
- Specified by:
getTime in interface LogicalOggStream
- Returns:
- the last parsed granule position of this stream
setTime
public void setTime(long granulePosition)
throws IOException
- Description copied from interface:
LogicalOggStream
- This method is invoked on all logical streams when
calling the same method on the physical stream. The
same restrictions as mentioned there apply.
This method does not work if the physical Ogg stream is not
seekable.
- Specified by:
setTime in interface LogicalOggStream
- Throws:
IOException - if an IO error occurs- See Also:
PhysicalOggStream.setTime(long)
checkFormat
public void checkFormat(OggPage page)
getFormat
public String getFormat()
- Specified by:
getFormat in interface LogicalOggStream
- Returns:
- the content type of this stream
- See Also:
LogicalOggStream.FORMAT_UNKNOWN,
LogicalOggStream.FORMAT_VORBIS,
LogicalOggStream.FORMAT_FLAC,
LogicalOggStream.FORMAT_THEORA
Copyright © 2007-2011
shredzone.org. All Rights Reserved.