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
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this stream.
     
    long
    This 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 method getNextOggPage.
    Note: To read from the stream, you must use either this method or the method getNextOggPacket.
    long
     
    boolean
    Checks if this stream is open for reading.
    void
    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.
  • Field Details

  • Method Details

    • getNextOggPage

      OggPage getNextOggPage() throws OggFormatException, IOException
      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.
      Returns:
      the next Ogg page
      Throws:
      OggFormatException - if the ogg stream is corrupted
      IOException - if some other IO error occurs
      See Also:
    • getNextOggPacket

      byte[] getNextOggPacket() throws OggFormatException, IOException
      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.
      Returns:
      the next packet as a byte array
      Throws:
      OggFormatException - if the ogg stream is corrupted
      IOException - if some other IO error occurs
      See Also:
    • isOpen

      boolean isOpen()
      Checks if this stream is open for reading.
      Returns:
      true if this stream is open for reading, false otherwise
    • close

      void close() throws IOException
      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

      void reset() throws OggFormatException, IOException
      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 corrupted
      IOException - 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

      void setTime(long granulePosition) throws IOException
      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: