uk.ac.cam.acr31.oggdecoder
Class BufferedOggStream

java.lang.Object
  extended by uk.ac.cam.acr31.oggdecoder.OggStream
      extended by uk.ac.cam.acr31.oggdecoder.BufferedOggStream
All Implemented Interfaces:
BufferListenerable

public class BufferedOggStream
extends OggStream
implements BufferListenerable


Nested Class Summary
private  class BufferedOggStream.FillThread
           
 
Field Summary
private  byte[] buf
           
private  BlockingRingBuffer buffer
           
private  BufferStatusListener bufferStatusListener
           
private  int bufSize
           
private  boolean closed
           
private  long readCounter
           
private  OggStream source
           
private  long writeCounter
           
 
Constructor Summary
BufferedOggStream(OggStream source, int bufSize)
           
 
Method Summary
 void close()
           
 long getAvailable()
           
 void read(byte[] buf, int off, int len)
           
 void setBufferStatusListener(BufferStatusListener l)
           
private  void throwEOS()
           
 
Methods inherited from class uk.ac.cam.acr31.oggdecoder.OggStream
advance, read16, read32, read64, read8
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

private BlockingRingBuffer buffer

source

private OggStream source

buf

private byte[] buf

readCounter

private long readCounter

writeCounter

private long writeCounter

closed

private boolean closed

bufferStatusListener

private BufferStatusListener bufferStatusListener

bufSize

private int bufSize
Constructor Detail

BufferedOggStream

public BufferedOggStream(OggStream source,
                         int bufSize)
Method Detail

setBufferStatusListener

public void setBufferStatusListener(BufferStatusListener l)
Specified by:
setBufferStatusListener in interface BufferListenerable

throwEOS

private void throwEOS()
               throws EndOfStreamException
Throws:
EndOfStreamException

read

public void read(byte[] buf,
                 int off,
                 int len)
          throws EndOfStreamException,
                 InvalidStreamException
Specified by:
read in class OggStream
Throws:
EndOfStreamException
InvalidStreamException

getAvailable

public long getAvailable()

close

public void close()
Specified by:
close in class OggStream