Class OggPageScanner


  • public class OggPageScanner
    extends java.lang.Object
    Scanner for determining OGG stream information by seeking around in it.
    • Constructor Summary

      Constructors 
      Constructor Description
      OggPageScanner​(long absoluteOffset, byte[] data, int dataLength)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<OggSeekPoint> createSeekTable​(int sampleRate, int targetSerial)
      Creates a seek table for the OGG stream.
      OggStreamSizeInfo scanForSizeInfo​(long firstPageOffset, int sampleRate, int targetSerial)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OggPageScanner

        public OggPageScanner​(long absoluteOffset,
                              byte[] data,
                              int dataLength)
        Parameters:
        absoluteOffset - Current position of the stream in bytes.
        data - Byte array with data starting at that position.
        dataLength - Length of data.
    • Method Detail

      • scanForSizeInfo

        public OggStreamSizeInfo scanForSizeInfo​(long firstPageOffset,
                                                 int sampleRate,
                                                 int targetSerial)
        Parameters:
        firstPageOffset - Absolute position of the first page in the stream.
        sampleRate - Sample rate of the track in the stream.
        Returns:
        If the data contains the header of the last page in the OGG stream, then stream size information, otherwise null.
      • createSeekTable

        public java.util.List<OggSeekPoint> createSeekTable​(int sampleRate,
                                                            int targetSerial)
        Creates a seek table for the OGG stream.
        Parameters:
        sampleRate - Sample rate of the track in the stream.
        Returns:
        A list of OggSeekPoint objects representing the seek points in the stream.