Package de.jarnbjo.ogg
Interface LogicalOggStream
- All Known Implementing Classes:
LogicalOggStreamImpl
public interface LogicalOggStream
Interface providing access to a logical Ogg stream as part of a
physical Ogg stream.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.
-
Field Details
-
FORMAT_UNKNOWN
- See Also:
-
FORMAT_VORBIS
- See Also:
-
FORMAT_FLAC
- See Also:
-
FORMAT_THEORA
- See Also:
-
-
Method Details
-
getNextOggPage
Note: To read from the stream, you must use either this method or the methodgetNextOggPacket. Mixing calls to the two methods will cause data corruption.- Returns:
- the next Ogg page
- Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs- See Also:
-
getNextOggPacket
Note: To read from the stream, you must use either this method or the methodgetNextOggPage. Mixing calls to the two methods will cause data corruption.- 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
boolean isOpen()Checks if this stream is open for reading.- Returns:
trueif this stream is open for reading,falseotherwise
-
close
Closes this stream. After invoking this method, no further access to the stream's data is possible.- Throws:
IOException- if an IO error occurs
-
reset
Sets the stream's position to the beginning of the stream. This method does not work if the physical Ogg stream is not seekable.- Throws:
OggFormatException- if the ogg stream is corruptedIOException- if some other IO error occurs
-
getMaximumGranulePosition
long getMaximumGranulePosition()This method does not work if the physical Ogg stream is not seekable.- Returns:
- the granule position of the last page within this stream
-
setTime
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.- Parameters:
granulePosition-- Throws:
IOException- if an IO error occurs- See Also:
-
getTime
long getTime()- Returns:
- the last parsed granule position of this stream
-
getFormat
String getFormat()- Returns:
- the content type of this stream
- See Also:
-