com.sleepycat.util
public class FastInputStream extends InputStream
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.
Field Summary | |
---|---|
protected byte[] | buf |
protected int | len |
protected int | mark |
protected int | off |
Constructor Summary | |
---|---|
FastInputStream(byte[] buffer)
Creates an input stream.
| |
FastInputStream(byte[] buffer, int offset, int length)
Creates an input stream.
|
Method Summary | |
---|---|
int | available() |
byte[] | getBufferBytes()
Returns the underlying data being read.
|
int | getBufferLength()
Returns the end of the buffer being read.
|
int | getBufferOffset()
Returns the offset at which data is being read from the buffer.
|
void | mark(int readLimit) |
boolean | markSupported() |
int | read() |
int | read(byte[] toBuf) |
int | read(byte[] toBuf, int offset, int length) |
int | readFast()
Equivalent to read() |
int | readFast(byte[] toBuf)
Equivalent to read(byte[]) |
int | readFast(byte[] toBuf, int offset, int length)
Equivalent to read(byte[],int,int) |
void | reset() |
long | skip(long count) |
void | skipFast(int count)
Equivalent to skip() |
Parameters: buffer the data to read.
Parameters: buffer the data to read. offset the byte offset at which to begin reading. length the number of bytes to read.
Returns: the underlying data.
Returns: the end of the buffer.
Returns: the offset at which data is being read.
read() but does not throw
IOException
.See Also: read
read(byte[]) but does not throw
IOException
.See Also: (byte[])
read(byte[],int,int) but does not throw
IOException
.See Also: (byte[],int,int)
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