Class OggInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.badlogic.gdx.backends.lwjgl3.audio.OggInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class OggInputStream extends java.io.InputStreamAn input stream to read Ogg Vorbis.
-
-
Constructor Summary
Constructors Constructor Description OggInputStream(java.io.InputStream input)Create a new stream to decode OGG dataOggInputStream(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 booleanatEnd()intavailable()voidclose()intgetChannels()intgetLength()Get the number of bytes on the streamintgetSampleRate()intread()intread(byte[] b)intread(byte[] b, int off, int len)
-
-
-
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 filepreviousStream- 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:
availablein classjava.io.InputStream- See Also:
InputStream.available()
-
read
public int read()
- Specified by:
readin classjava.io.InputStream
-
atEnd
public boolean atEnd()
-
read
public int read(byte[] b, int off, int len)- Overrides:
readin classjava.io.InputStream
-
read
public int read(byte[] b)
- Overrides:
readin classjava.io.InputStream
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
-