de.netseeker.ejoe.io
Class ByteBufferInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byde.netseeker.ejoe.io.ByteBufferInputStream

public class ByteBufferInputStream
extends java.io.InputStream

Implements an input stream over a NIO ByteBuffer. The ByteBuffer is replacable, and is supplied by an external source. This class is based on an article found at the homepage of Michael W. Spille.

Author:
Michael W. Spille, netseeker aka Michael Manske

Constructor Summary
ByteBufferInputStream(java.nio.ByteBuffer buffer)
          Constructs a new ByteBufferInputStream which reads from specified buffer
 
Method Summary
 int available()
           
 void close()
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int offset, int length)
           
 void setByteBuffer(java.nio.ByteBuffer buffer)
           
 
Methods inherited from class java.io.InputStream
mark, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferInputStream

public ByteBufferInputStream(java.nio.ByteBuffer buffer)
Constructs a new ByteBufferInputStream which reads from specified buffer

Method Detail

setByteBuffer

public void setByteBuffer(java.nio.ByteBuffer buffer)
Parameters:
buffer -

available

public int available()

close

public void close()

markSupported

public boolean markSupported()

read

public int read()

read

public int read(byte[] b)

read

public int read(byte[] b,
                int offset,
                int length)


Copyright © 2005-2006 netseeker. All Rights Reserved.