|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface ReadBuffer.BufferInput
The BufferInput interface represents a DataInputStream on top of a ReadBuffer.
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without causing a blocking I/O condition to occur. |
void |
close()
Close the InputStream and release any system resources associated with it. |
ReadBuffer |
getBuffer()
Get the ReadBuffer object that this BufferInput is reading from. |
int |
getOffset()
Determine the current offset of this BufferInput within the underlying ReadBuffer. |
void |
mark(int cbReadLimit)
Marks the current read position in the InputStream in order to support the stream to be later "rewound" (using the InputStreaming.reset()
method) to the current position. |
boolean |
markSupported()
Determine if this InputStream supports the mark(int) and
InputStreaming.reset() methods. |
ReadBuffer |
readBuffer(int cb)
Read cb bytes and return them as a ReadBuffer object. |
int |
readPackedInt()
Read an int value using a variable-length storage-format. |
long |
readPackedLong()
Read a long value using a variable-length storage-format. |
String |
readSafeUTF()
Read a variable-length encoded UTF packed String. |
void |
setOffset(int of)
Specify the offset of the next byte to read from the underlying ReadBuffer. |
Methods inherited from interface com.tangosol.io.InputStreaming |
---|
read, read, read, reset, skip |
Methods inherited from interface java.io.DataInput |
---|
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes |
Method Detail |
---|
int available() throws IOException
BufferInput implementations must implement this method to return the extent of the buffer that has not yet been read; in other words, the entire un-read portion of the buffer must be available.
available
in interface InputStreaming
IOException
- if an I/O error occursvoid close() throws IOException
BufferInput implementations do not pass this call down onto an underlying stream, if any.
close
in interface InputStreaming
IOException
- if an I/O error occursvoid mark(int cbReadLimit)
InputStreaming.reset()
method) to the current position. The caller passes in the maximum
number of bytes that it expects to read before calling the
InputStreaming.reset()
method, thus indicating the upper bounds of the
responsibility of the stream to be able to buffer what it has read
in order to support this functionality.
BufferInput implementations ignore the cbReadLimit
;
they must support an unlimited read limit, since they appear to the
user as an input stream on top of a fully realized read buffer.
mark
in interface InputStreaming
cbReadLimit
- the maximum number of bytes that caller expects
the InputStream to be able to read before the
mark position becomes invalidboolean markSupported()
mark(int)
and
InputStreaming.reset()
methods.
BufferInput implementations must support the mark(int)
and InputStreaming.reset()
methods, so this method always returns
true
.
markSupported
in interface InputStreaming
true
if this InputStream supports the mark
and reset method; false
otherwiseReadBuffer getBuffer()
String readSafeUTF() throws IOException
IOException
- if an I/O error occursint readPackedInt() throws IOException
IOException
- if an I/O error occurslong readPackedLong() throws IOException
IOException
- if an I/O error occursReadBuffer readBuffer(int cb) throws IOException
cb
bytes and return them as a ReadBuffer object.
cb
- the number of bytes to read
cb
bytes read
from the BufferInput
EOFException
- if the stream is exhausted before
the number of bytes indicated could be read
IOException
- if an I/O error occursint getOffset()
void setOffset(int of)
of
- the offset of the next byte to read from the ReadBuffer
IndexOutOfBoundsException
- if of < 0
or
of > getBuffer().length()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |