uk.ac.cam.acr31.oggdecoder
Class RingBuffer

java.lang.Object
  extended by uk.ac.cam.acr31.oggdecoder.RingBuffer

public class RingBuffer
extends java.lang.Object


Field Summary
private  java.nio.ByteBuffer buffer
           
private  int bufferSize
           
private  int bytesAvailable
           
private  int bytesRemaining
           
private  int readPointer
           
private  int writePointer
           
 
Constructor Summary
RingBuffer(int bufferSize)
           
 
Method Summary
 int getBytesAvailable()
           
 int getBytesRemaining()
           
 int read(byte[] data, int off, int len)
           
 void write(byte[] data, int off, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferSize

private int bufferSize

buffer

private java.nio.ByteBuffer buffer

readPointer

private int readPointer

writePointer

private int writePointer

bytesRemaining

private int bytesRemaining

bytesAvailable

private int bytesAvailable
Constructor Detail

RingBuffer

public RingBuffer(int bufferSize)
Method Detail

getBytesRemaining

public int getBytesRemaining()

getBytesAvailable

public int getBytesAvailable()

write

public void write(byte[] data,
                  int off,
                  int len)
           throws BufferOverflowException
Throws:
BufferOverflowException

read

public int read(byte[] data,
                int off,
                int len)
         throws BufferUnderflowException
Throws:
BufferUnderflowException