Class SoundDataStream
java.lang.Object
java.io.InputStream
de.mrjulsen.dragnsounds.core.data.SoundDataStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
close()
int
int
int
long
boolean
hasSpace
(int length) boolean
isPacketNeeded
(int packetIndex) void
queue
(SoundDataPacket packet) int
read()
int
read
(byte[] data) int
read
(byte[] b, int off, int len) int
int
boolean
shouldReject
(int packetIndex) int
boolean
willHaveSpace
(int length) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
SoundDataStream
public SoundDataStream(int initialSize, long soundId)
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
getSoundId
public long getSoundId() -
hasSpace
public boolean hasSpace(int length) -
willHaveSpace
public boolean willHaveSpace(int length) -
remainingSpaceAfterRequest
public int remainingSpaceAfterRequest() -
remainingSpace
public int remainingSpace() -
filledSpaceAfterRequest
public int filledSpaceAfterRequest() -
filledSpace
public int filledSpace() -
totalSpace
public int totalSpace() -
currentlyNeeded
public int currentlyNeeded() -
isPacketNeeded
public boolean isPacketNeeded(int packetIndex) -
canRequestData
public boolean canRequestData() -
shouldReject
public boolean shouldReject(int packetIndex) -
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] data) - Overrides:
read
in classInputStream
-
queue
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-