Package net.raphimc.audiomixer.util
Class CircularByteBuffer
java.lang.Object
net.raphimc.audiomixer.util.CircularByteBuffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()intintgetSize()booleanhasSpaceFor(int length) booleanisEmpty()booleanisFull()byteread()voidreadAllSafe(byte[] values) voidreadAllSafe(byte[] values, byte defaultValue) voidreadAllSafe(byte[] values, int valuesLength) voidreadAllSafe(byte[] values, int valuesLength, byte defaultValue) byte[]readAllSafe(int size) byte[]readAllSafe(int size, byte defaultValue) bytereadSafe()bytereadSafe(byte defaultValue) voidwrite(byte value) voidwriteAll(byte[] values) voidwriteAll(byte[] values, int valuesLength)
-
Constructor Details
-
CircularByteBuffer
public CircularByteBuffer(int capacity)
-
-
Method Details
-
write
public void write(byte value) -
writeAll
public void writeAll(byte[] values) -
writeAll
public void writeAll(byte[] values, int valuesLength) -
read
public byte read() -
readSafe
public byte readSafe() -
readSafe
public byte readSafe(byte defaultValue) -
readAllSafe
public byte[] readAllSafe(int size) -
readAllSafe
public byte[] readAllSafe(int size, byte defaultValue) -
readAllSafe
public void readAllSafe(byte[] values) -
readAllSafe
public void readAllSafe(byte[] values, byte defaultValue) -
readAllSafe
public void readAllSafe(byte[] values, int valuesLength) -
readAllSafe
public void readAllSafe(byte[] values, int valuesLength, byte defaultValue) -
clear
public void clear() -
hasSpaceFor
public boolean hasSpaceFor(int length) -
isEmpty
public boolean isEmpty() -
isFull
public boolean isFull() -
getSize
public int getSize() -
getCapacity
public int getCapacity()
-