org.fusesource.hawtbuf
Class BufferInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.fusesource.hawtbuf.BufferInputStream
All Implemented Interfaces:
Closeable

public final class BufferInputStream
extends InputStream

Very similar to the java.io.ByteArrayInputStream but this version is not thread safe.

Author:
Hiram Chirino

Constructor Summary
BufferInputStream(Buffer sequence)
           
BufferInputStream(byte[] data)
           
BufferInputStream(byte[] data, int offset, int size)
           
 
Method Summary
 int available()
           
 void mark(int markpos)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 Buffer readBuffer(int len)
           
 void reset()
           
 long skip(long len)
           
 
Methods inherited from class java.io.InputStream
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferInputStream

public BufferInputStream(byte[] data)

BufferInputStream

public BufferInputStream(Buffer sequence)

BufferInputStream

public BufferInputStream(byte[] data,
                         int offset,
                         int size)
Method Detail

read

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

read

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

read

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

readBuffer

public Buffer readBuffer(int len)

skip

public long skip(long len)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

available

public int available()
Overrides:
available in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

mark

public void mark(int markpos)
Overrides:
mark in class InputStream

reset

public void reset()
Overrides:
reset in class InputStream


Copyright © 2010-2014 FuseSource, Corp.. All Rights Reserved.