public class LogicalOggStreamImpl extends java.lang.Object implements LogicalOggStream
FORMAT_FLAC, FORMAT_THEORA, FORMAT_UNKNOWN, FORMAT_VORBIS
Constructor and Description |
---|
LogicalOggStreamImpl(PhysicalOggStream source,
int serialNumber) |
Modifier and Type | Method and Description |
---|---|
void |
addGranulePosition(long granulePosition) |
void |
addPageNumberMapping(int physicalPageNumber) |
void |
checkFormat(OggPage page) |
void |
close()
Closes this stream.
|
java.lang.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.
|
public LogicalOggStreamImpl(PhysicalOggStream source, int serialNumber)
public void addPageNumberMapping(int physicalPageNumber)
public void addGranulePosition(long granulePosition)
public void reset() throws OggFormatException, java.io.IOException
LogicalOggStream
reset
in interface LogicalOggStream
OggFormatException
- if the ogg stream is corruptedjava.io.IOException
- if some other IO error occurspublic OggPage getNextOggPage() throws EndOfOggStreamException, OggFormatException, java.io.IOException
LogicalOggStream
getNextOggPacket
.
Mixing calls to the two methods will cause data corruption.getNextOggPage
in interface LogicalOggStream
OggFormatException
- if the ogg stream is corruptedjava.io.IOException
- if some other IO error occursEndOfOggStreamException
LogicalOggStream.getNextOggPacket()
public byte[] getNextOggPacket() throws EndOfOggStreamException, OggFormatException, java.io.IOException
LogicalOggStream
getNextOggPage
.
Mixing calls to the two methods will cause data corruption.getNextOggPacket
in interface LogicalOggStream
OggFormatException
- if the ogg stream is corruptedjava.io.IOException
- if some other IO error occursEndOfOggStreamException
LogicalOggStream.getNextOggPage()
public boolean isOpen()
LogicalOggStream
isOpen
in interface LogicalOggStream
true
if this stream is open for reading,
false
otherwisepublic void close() throws java.io.IOException
LogicalOggStream
close
in interface LogicalOggStream
java.io.IOException
- if an IO error occurspublic long getMaximumGranulePosition()
LogicalOggStream
getMaximumGranulePosition
in interface LogicalOggStream
public long getTime()
getTime
in interface LogicalOggStream
public void setTime(long granulePosition) throws java.io.IOException
LogicalOggStream
setTime
in interface LogicalOggStream
java.io.IOException
- if an IO error occursPhysicalOggStream.setTime(long)
public void checkFormat(OggPage page)
public java.lang.String getFormat()
getFormat
in interface LogicalOggStream
LogicalOggStream.FORMAT_UNKNOWN
,
LogicalOggStream.FORMAT_VORBIS
,
LogicalOggStream.FORMAT_FLAC
,
LogicalOggStream.FORMAT_THEORA
Copyright © 2014 Tor-Einar Jarnbjo. All Rights Reserved.