Package de.jarnbjo.ogg
Class LogicalOggStreamImpl
java.lang.Object
de.jarnbjo.ogg.LogicalOggStreamImpl
- All Implemented Interfaces:
LogicalOggStream
-
Field Summary
Fields inherited from interface de.jarnbjo.ogg.LogicalOggStream
FORMAT_FLAC, FORMAT_THEORA, FORMAT_UNKNOWN, FORMAT_VORBIS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGranulePosition(long granulePosition) voidaddPageNumberMapping(int physicalPageNumber) voidcheckFormat(OggPage page) voidclose()Closes this stream.longThis method does not work if the physical Ogg stream is not seekable.byte[]Note: To read from the stream, you must use either this method or the methodgetNextOggPage.Note: To read from the stream, you must use either this method or the methodgetNextOggPacket.longgetTime()booleanisOpen()Checks if this stream is open for reading.voidreset()Sets the stream's position to the beginning of the stream.voidsetTime(long granulePosition) This method is invoked on all logical streams when calling the same method on the physical stream.
-
Constructor Details
-
LogicalOggStreamImpl
-
-
Method Details
-
addPageNumberMapping
public void addPageNumberMapping(int physicalPageNumber) -
addGranulePosition
public void addGranulePosition(long granulePosition) -
reset
Description copied from interface:LogicalOggStreamSets 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:
resetin interfaceLogicalOggStream- Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs
-
getNextOggPage
Description copied from interface:LogicalOggStreamNote: To read from the stream, you must use either this method or the methodgetNextOggPacket. Mixing calls to the two methods will cause data corruption.- Specified by:
getNextOggPagein interfaceLogicalOggStream- Returns:
- the next Ogg page
- Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs- See Also:
-
getNextOggPacket
Description copied from interface:LogicalOggStreamNote: To read from the stream, you must use either this method or the methodgetNextOggPage. Mixing calls to the two methods will cause data corruption.- Specified by:
getNextOggPacketin interfaceLogicalOggStream- Returns:
- the next packet as a byte array
- Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs- See Also:
-
isOpen
public boolean isOpen()Description copied from interface:LogicalOggStreamChecks if this stream is open for reading.- Specified by:
isOpenin interfaceLogicalOggStream- Returns:
trueif this stream is open for reading,falseotherwise
-
close
Description copied from interface:LogicalOggStreamCloses this stream. After invoking this method, no further access to the stream's data is possible.- Specified by:
closein interfaceLogicalOggStream- Throws:
IOException- if an IO error occurs
-
getMaximumGranulePosition
public long getMaximumGranulePosition()Description copied from interface:LogicalOggStreamThis method does not work if the physical Ogg stream is not seekable.- Specified by:
getMaximumGranulePositionin interfaceLogicalOggStream- Returns:
- the granule position of the last page within this stream
-
getTime
public long getTime()- Specified by:
getTimein interfaceLogicalOggStream- Returns:
- the last parsed granule position of this stream
-
setTime
Description copied from interface:LogicalOggStreamThis 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:
setTimein interfaceLogicalOggStream- Throws:
IOException- if an IO error occurs- See Also:
-
checkFormat
-
getFormat
- Specified by:
getFormatin interfaceLogicalOggStream- Returns:
- the content type of this stream
- See Also:
-