public class RingBuffer extends Object
| Constructor and Description |
|---|
RingBuffer(int planes)
Creates a RingBuffer with a default buffer size of 1024 bytes.
|
RingBuffer(int capacity,
int planes)
Creates a RingBuffer with the specified buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Return the readable amount of bytes in buffer.
|
void |
clear()
Resets the read and write pointers.
|
int |
read(int plane,
byte[] data)
Read as much data as possible from this buffer.
|
int |
read(int plane,
byte[] data,
int offset,
int length)
Read as much data as possible from this buffer.
|
int |
write(int plane,
byte[] data)
Write as much data as possible to this buffer.
|
int |
write(int plane,
byte[] data,
int offset,
int length)
Write as much data as possible to this buffer.
|
int |
write(int plane,
ByteBuffer buffer)
Write as much data as possible to this buffer.
|
public RingBuffer(int planes)
public RingBuffer(int capacity,
int planes)
capacity - buffer size in bytespublic void clear()
public int available()
public int write(int plane,
ByteBuffer buffer)
plane - the audio channel.buffer - data to be written.public int write(int plane,
byte[] data)
plane - the audio channel.data - data to be written.public int write(int plane,
byte[] data,
int offset,
int length)
plane - the audio channel.data - array holding data to be writtenoffset - offset of data in arraylength - amount of data to write, starting from off.public int read(int plane,
byte[] data)
throws IOException
plane - the audio channel.data - where to store the data.IOException - if data array could not be filled.public int read(int plane,
byte[] data,
int offset,
int length)
throws IOException
plane - the audio channel.data - where to store the read data.offset - offset of data in array.length - amount of data to read.IOExceptionCopyright © 2013. All Rights Reserved.