bamboo.util
Class MultipleByteBufferInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by bamboo.util.MultipleByteBufferInputStream
All Implemented Interfaces:
Closeable

public class MultipleByteBufferInputStream
extends InputStream

Wraps a java.nio.ByteBuffer in the ostore.util.InputBuffer interface.

Version:
$Id: MultipleByteBufferInputStream.java,v 1.1 2005/01/24 03:30:42 srhea Exp $
Author:
Sean C. Rhea

Field Summary
protected  LinkedList buffers
           
protected  int remaining
           
protected  int size
           
 
Constructor Summary
MultipleByteBufferInputStream()
           
 
Method Summary
 void add_bb(ByteBuffer bb)
           
 int limit_remaining()
           
 void limit(int sz)
           
 int read_skip_impl(byte[] output, int offset, int length)
           
 int read()
           
 int read(byte[] output)
           
 int read(byte[] output, int offset, int length)
           
 long skip(long n)
           
 void unlimit()
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size

buffers

protected LinkedList buffers

remaining

protected int remaining
Constructor Detail

MultipleByteBufferInputStream

public MultipleByteBufferInputStream()
Method Detail

unlimit

public void unlimit()

limit

public void limit(int sz)

limit_remaining

public int limit_remaining()

add_bb

public void add_bb(ByteBuffer bb)

read

public int read()
Specified by:
read in class InputStream

read

public int read(byte[] output)
Overrides:
read in class InputStream

read

public int read(byte[] output,
                int offset,
                int length)
Overrides:
read in class InputStream

read_skip_impl

public int read_skip_impl(byte[] output,
                          int offset,
                          int length)

skip

public long skip(long n)
Overrides:
skip in class InputStream