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 interface
A functional interface for providing an AudioStream from an InputStream.(package private) static class
A FilterInputStream that does not close the underlying InputStream. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BufferedInputStream
private final LoopingAudioStream.AudioStreamProvider
private 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:
getFormat
in 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:
read
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-