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)  
    • 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)
        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)
        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.