Class OggInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class OggInputStream
    extends java.io.InputStream
    An input stream to read Ogg Vorbis.
    • Constructor Summary

      Constructors 
      Constructor Description
      OggInputStream​(java.io.InputStream input)
      Create a new stream to decode OGG data
      OggInputStream​(java.io.InputStream input, OggInputStream previousStream)
      Create a new stream to decode OGG data, reusing buffers from another stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean atEnd()  
      int available()  
      void close()  
      int getChannels()  
      int getLength()
      Get the number of bytes on the stream
      int getSampleRate()  
      int read()  
      int read​(byte[] b)  
      int read​(byte[] b, int off, int len)  
      • Methods inherited from class java.io.InputStream

        mark, markSupported, reset, skip
      • Methods inherited from class java.lang.Object

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

      • OggInputStream

        public OggInputStream​(java.io.InputStream input)
        Create a new stream to decode OGG data
        Parameters:
        input - The input stream from which to read the OGG file
      • OggInputStream

        public OggInputStream​(java.io.InputStream input,
                              OggInputStream previousStream)
        Create a new stream to decode OGG data, reusing buffers from another stream. It's not a good idea to use the old stream instance afterwards.
        Parameters:
        input - The input stream from which to read the OGG file
        previousStream - The stream instance to reuse buffers from, may be null
    • Method Detail

      • getLength

        public int getLength()
        Get the number of bytes on the stream
        Returns:
        The number of the bytes on the stream
      • getChannels

        public int getChannels()
      • getSampleRate

        public int getSampleRate()
      • available

        public int available()
        Overrides:
        available in class java.io.InputStream
        See Also:
        InputStream.available()
      • read

        public int read()
        Specified by:
        read in class java.io.InputStream
      • atEnd

        public boolean atEnd()
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
        Overrides:
        read in class java.io.InputStream
      • read

        public int read​(byte[] b)
        Overrides:
        read in class java.io.InputStream
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream