com.github.libxjava.io
Class ByteArrayBuffer.Reader

java.lang.Object
  extended by java.io.InputStream
      extended by com.github.libxjava.io.ByteArrayBuffer.Reader
All Implemented Interfaces:
Closeable
Enclosing class:
ByteArrayBuffer

public final class ByteArrayBuffer.Reader
extends InputStream


Constructor Summary
ByteArrayBuffer.Reader()
           
 
Method Summary
 int available()
           
 void mark(int readlimit)
          Marks the current position in this input stream.
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 
Methods inherited from class java.io.InputStream
close, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayBuffer.Reader

public ByteArrayBuffer.Reader()
Method Detail

available

public int available()
Overrides:
available in class InputStream

mark

public void mark(int readlimit)
Marks the current position in this input stream. A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes.

The readlimit arguments tells this input stream to allow that many bytes to be read before the mark position gets invalidated. readlimit must never be higher then ByteArrayBuffer.capacity() - 1!

Overrides:
mark in class InputStream
Parameters:
readlimit - the maximum limit of bytes that can be read before the mark position becomes invalid.
Throws:
IllegalArgumentException - if readlimit exceeds the buffer size

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException


Copyright © 2010 Marcel Patzlaff. All Rights Reserved.