|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.util.InputBufferImpl | +--ostore.util.ByteArrayInputBuffer
The ByteArrayInputBuffer
is a utility class that
provides an InputBuffer
interface to a byte array.
It can also provide provide the interface over only a portion of
the array.
Constructor Summary | |
ByteArrayInputBuffer()
|
|
ByteArrayInputBuffer(byte[] data)
|
|
ByteArrayInputBuffer(byte[] data,
int offset,
int length)
|
Method Summary | |
int |
bytesRemaining()
Return the number of bytes remaining in the buffer. |
Object |
clone()
Buffers must support clone such that the read pointer on a cloned buffer is independent of the original. |
int |
getOffset()
Returns the current offset into the original array |
byte |
nextByte()
Read the next byte out of the buffer. |
void |
nextBytes(byte[] output,
int offset,
int length)
Read the next length bytes out the of the buffer, and
place them in the array output , starting at index
offset . |
void |
nextBytes(OutputBuffer buffer)
Write all of the remaining bytes in this input buffer into the given output buffer. |
void |
reset(byte[] data)
Reuse the buffer with a new array of bytes. |
void |
reset(byte[] data,
int offset,
int length)
Reuse the buffer with a new array of bytes. |
void |
skipBytes(int length)
|
InputBuffer |
subBuffer(int length)
Create a new input buffer from the read point at this one, containing the next length bytes. |
Methods inherited from class ostore.util.InputBufferImpl |
nextBigInteger, nextBigInteger, nextBoolean, nextBoolean, nextDouble, nextDouble, nextInt, nextInt, nextLong, nextLong, nextObject, nextObject, nextShort, nextShort, nextString, nextString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ByteArrayInputBuffer()
public ByteArrayInputBuffer(byte[] data)
public ByteArrayInputBuffer(byte[] data, int offset, int length)
Method Detail |
public byte nextByte()
InputBuffer
public void nextBytes(byte[] output, int offset, int length)
InputBuffer
length
bytes out the of the buffer, and
place them in the array output
, starting at index
offset
.ostore.util.InputBuffer
output
- the array into which the bytes are writtenoffset
- the index in output
at which we start
writing byteslength
- the number of bytes to readpublic void nextBytes(OutputBuffer buffer)
InputBuffer
ostore.util.InputBuffer
output
- the output buffer into which the bytes are writtenlength
- the number of bytes to readpublic void skipBytes(int length)
public InputBuffer subBuffer(int length)
InputBuffer
public int getOffset()
public int bytesRemaining()
public void reset(byte[] data)
public void reset(byte[] data, int offset, int length)
public Object clone() throws CloneNotSupportedException
InputBuffer
clone
in class InputBufferImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |