public class WrapperBufferInput extends WrapperDataInputStream implements ReadBuffer.BufferInput
| Modifier and Type | Class and Description |
|---|---|
static class |
WrapperBufferInput.VersionAwareBufferInput
A BufferInput implementation that in addition to delegating to the given
DataInput provides an API to check whether the sender of the content of
this BufferInput runs a version that supersedes (greater or equal to)
the specified version.
|
m_in, m_loader| Constructor and Description |
|---|
WrapperBufferInput(DataInput in)
Construct a WrapperBufferInput that will read from the specified object
implementing the DataInput interface.
|
WrapperBufferInput(DataInput in,
ClassLoader loader)
Construct a WrapperBufferInput that will read from the specified object
implementing the DataInput interface.
|
| Modifier and Type | Method and Description |
|---|---|
ReadBuffer |
getBuffer()
Get the ReadBuffer object that this BufferInput is reading from.
|
DataInput |
getDataInput()
Obtain the underlying object providing the DataInput interface that
this object is delegating to.
|
Object |
getObjectInputFilter()
Returns an ObjectInputFilter (or null) that should be used by the caller
to confirm / deny deserialization of a class encoded in this input stream.
|
int |
getOffset()
Determine the current offset of this BufferInput within the
underlying ReadBuffer.
|
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 as described
by
WriteBuffer.BufferOutput.writePackedInt(int). |
long |
readPackedLong()
Read a long value using a variable-length storage format as described
by
WriteBuffer.BufferOutput.writePackedLong(long). |
String |
readSafeUTF()
Read a variable-length encoded UTF packed String.
|
void |
setObjectInputFilter(Object filter)
Set the
ObjectInputFilter for this stream. |
void |
setOffset(int of)
Specify the offset of the next byte to read from the underlying
ReadBuffer.
|
available, close, getClassLoader, mark, markSupported, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, reset, setClassLoader, skip, skipBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitavailable, close, mark, markSupported, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytespublic WrapperBufferInput(DataInput in)
in - an object implementing DataInput to read frompublic WrapperBufferInput(DataInput in, ClassLoader loader)
in - an object implementing DataInput to read fromloader - the ClassLoader to usepublic ReadBuffer getBuffer()
getBuffer in interface ReadBuffer.BufferInputpublic String readSafeUTF() throws IOException
readSafeUTF in interface ReadBuffer.BufferInputIOException - if an I/O error occurspublic int readPackedInt()
throws IOException
WriteBuffer.BufferOutput.writePackedInt(int).readPackedInt in interface ReadBuffer.BufferInputIOException - if an I/O error occurspublic long readPackedLong()
throws IOException
WriteBuffer.BufferOutput.writePackedLong(long).readPackedLong in interface ReadBuffer.BufferInputIOException - if an I/O error occurspublic ReadBuffer readBuffer(int cb) throws IOException
cb bytes and return them as a ReadBuffer object.readBuffer in interface ReadBuffer.BufferInputcb - the number of bytes to readcb bytes read
from the BufferInputEOFException - if the stream is exhausted before
the number of bytes indicated could be readIOException - if an I/O error occurspublic int getOffset()
getOffset in interface ReadBuffer.BufferInputpublic void setOffset(int of)
setOffset in interface ReadBuffer.BufferInputof - the offset of the next byte to read from the ReadBufferpublic Object getObjectInputFilter()
ReadBuffer.BufferInputNote: the return type is agnostic of the ObjectInputFilter to support various JDK versions.
getObjectInputFilter in interface ReadBuffer.BufferInputReadBuffer.BufferInput.setObjectInputFilter(Object)public void setObjectInputFilter(Object filter)
ReadBuffer.BufferInputObjectInputFilter for this stream.
The filter's checkInput method is expected to be called for each class and reference deserialized in the stream.
setObjectInputFilter in interface ReadBuffer.BufferInputfilter - an ObjectInputFilter instance as an Object to enable
running with Java version 8 or higher, may be nullpublic DataInput getDataInput()
getDataInput in class WrapperDataInputStream