Package net.minecraft.client.sounds
Class LoopingAudioStream
java.lang.Object
net.minecraft.client.sounds.LoopingAudioStream
- All Implemented Interfaces:
Closeable,AutoCloseable,AudioStream
The LoopingAudioStream class provides an AudioStream that loops indefinitely over the provided InputStream.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA functional interface for providing an AudioStream from an InputStream.(package private) static classA FilterInputStream that does not close the underlying InputStream. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BufferedInputStreamprivate final LoopingAudioStream.AudioStreamProviderprivate AudioStream -
Constructor Summary
ConstructorsConstructorDescriptionLoopingAudioStream(LoopingAudioStream.AudioStreamProvider pProvider, InputStream pInputStream) -
Method Summary
-
Field Details
-
provider
-
stream
-
bufferedInputStream
-
-
Constructor Details
-
LoopingAudioStream
public LoopingAudioStream(LoopingAudioStream.AudioStreamProvider pProvider, InputStream pInputStream) throws IOException - Throws:
IOException
-
-
Method Details
-
getFormat
- Specified by:
getFormatin interfaceAudioStream
-
read
Reads audio data from the stream and returns a byte buffer containing at most the specified number of bytes. The method reads audio frames from the stream and adds them to the output buffer until the buffer contains at least the specified number of bytes or the end fo the stream is reached.- Specified by:
readin interfaceAudioStream- Parameters:
pSize- the maximum number of bytes to read- Returns:
- a byte buffer containing at most the specified number of bytes to read
- Throws:
IOException- if an I/O error occurs while reading the audio data
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-