|
|
|
Berkeley DB version 4.4.20 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream com.sleepycat.util.FastInputStream
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.
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 pos)
|
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)
|
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 |
Field Detail |
protected int len
protected int off
protected int mark
protected byte[] buf
Constructor Detail |
public FastInputStream(byte[] buffer)
buffer
- the data to read.public FastInputStream(byte[] buffer, int offset, int length)
buffer
- the data to read.offset
- the byte offset at which to begin reading.length
- the number of bytes to read.Method Detail |
public int available()
public boolean markSupported()
public void mark(int pos)
public void reset()
public long skip(long count)
public int read() throws IOException
IOException
public int read(byte[] toBuf) throws IOException
IOException
public int read(byte[] toBuf, int offset, int length) throws IOException
IOException
public final int readFast()
read() but does not throw
IOException
.
- See Also:
read()
public final int readFast(byte[] toBuf)
read(byte[]) but does not throw
IOException
.
- See Also:
read(byte[])
public final int readFast(byte[] toBuf, int offset, int length)
read(byte[],int,int) but does not throw
IOException
.
- See Also:
read(byte[],int,int)
public final byte[] getBufferBytes()
public final int getBufferOffset()
public final int getBufferLength()
|
Berkeley DB version 4.4.20 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |