| java.lang.Object java.io.InputStream com.sleepycat.util.FastInputStream
All known Subclasses: com.sleepycat.bind.tuple.TupleInput,
FastInputStream | public class FastInputStream extends InputStream (Code) | | A replacement for ByteArrayInputStream that does not synchronize every
byte read.
This class extends
InputStream and its read()
methods allow it to be used as a standard input stream. In addition, it
provides readFast() methods that are not declared to throw
IOException . IOException is never thrown by this
class.
author: Mark Hayes |
Field Summary | |
protected byte[] | buf | protected int | len | protected int | mark | protected int | off |
Constructor Summary | |
public | FastInputStream(byte[] buffer) Creates an input stream. | public | FastInputStream(byte[] buffer, int offset, int length) Creates an input stream. |
Method Summary | |
public int | available() | final public byte[] | getBufferBytes() Returns the underlying data being read. | final public int | getBufferLength() Returns the end of the buffer being read. | final public int | getBufferOffset() Returns the offset at which data is being read from the buffer. | public void | mark(int readLimit) | public boolean | markSupported() | public int | read() | public int | read(byte[] toBuf) | public int | read(byte[] toBuf, int offset, int length) | final public int | readFast() Equivalent to read() but does not throw
IOException . | final public int | readFast(byte[] toBuf) Equivalent to read(byte[]) but does not throw
IOException . | final public int | readFast(byte[] toBuf, int offset, int length) Equivalent to read(byte[],int,int) but does not throw
IOException . | public void | reset() | public long | skip(long count) | final public void | skipFast(int count) Equivalent to skip() but takes an int parameter instead of a
long, and does not check whether the count given is larger than the
number of remaining bytes. |
FastInputStream | public FastInputStream(byte[] buffer)(Code) | | Creates an input stream.
Parameters: buffer - the data to read. |
FastInputStream | public FastInputStream(byte[] buffer, int offset, int length)(Code) | | Creates an input stream.
Parameters: buffer - the data to read. Parameters: offset - the byte offset at which to begin reading. Parameters: length - the number of bytes to read. |
available | public int available()(Code) | | |
getBufferBytes | final public byte[] getBufferBytes()(Code) | | Returns the underlying data being read.
the underlying data. |
getBufferLength | final public int getBufferLength()(Code) | | Returns the end of the buffer being read.
the end of the buffer. |
getBufferOffset | final public int getBufferOffset()(Code) | | Returns the offset at which data is being read from the buffer.
the offset at which data is being read. |
mark | public void mark(int readLimit)(Code) | | |
markSupported | public boolean markSupported()(Code) | | |
reset | public void reset()(Code) | | |
skip | public long skip(long count)(Code) | | |
skipFast | final public void skipFast(int count)(Code) | | Equivalent to skip() but takes an int parameter instead of a
long, and does not check whether the count given is larger than the
number of remaining bytes.
See Also: FastInputStream.skip(long) |
|
|