Package org.fusesource.hawtbuf
Class BufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.fusesource.hawtbuf.BufferInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class BufferInputStream extends java.io.InputStreamVery similar to the java.io.ByteArrayInputStream but this version is not thread safe.
-
-
Constructor Summary
Constructors Constructor Description BufferInputStream(byte[] data)BufferInputStream(byte[] data, int offset, int size)BufferInputStream(Buffer sequence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidmark(int markpos)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)BufferreadBuffer(int len)voidreset()longskip(long len)
-
-
-
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 java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len)- Overrides:
readin classjava.io.InputStream
-
readBuffer
public Buffer readBuffer(int len)
-
skip
public long skip(long len) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
mark
public void mark(int markpos)
- Overrides:
markin classjava.io.InputStream
-
reset
public void reset()
- Overrides:
resetin classjava.io.InputStream
-
-