public abstract class AbstractJBaseObjectReader extends java.lang.Object implements JBaseObjectReader
and NIOJBaseObjectReader.
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
AbstractJBaseObjectReader() |
Modifier and Type | Method and Description |
---|---|
protected int |
bufferedRead() |
protected java.nio.ByteBuffer |
checkBuffer(java.nio.ByteBuffer bBuf,
int newDataLength) |
abstract void |
close() |
protected abstract byte |
getByte() |
protected abstract int |
getBytes(byte[] buf) |
protected abstract int |
getBytes(java.nio.ByteBuffer bBuf) |
protected abstract int |
getInt() |
protected abstract ObjectFactory |
getObjectFactory()
This method must be implemented by concrete ObjectReaders.
|
protected abstract int |
inBytes(int numberOfBytesToRead) |
protected IByteObject |
readByteObject(char code,
IByteObject o) |
byte[] |
readBytes() |
int |
readInt()
Reads a 32 bits integer from the underlying InputStream.
|
protected JBaseSerializable |
readJBaseSerializableObject(char code,
JBaseSerializable o) |
java.lang.Object |
readObject()
Deserializes next object from the underlying InputStream.
|
IByteObject |
readObject(IByteObject o)
Reads/deserializes next byte object, a new ByteObject will be created and returned
if a null argument is passed in.
|
JBaseSerializable |
readObject(JBaseSerializable o)
Reads/deserializes next object, the ObjectFactory will be used to create a
JBaseSerializable object if a null argument is passed in.
|
JBaseSerializable |
readRootObject()
Deserializes a root object.
|
java.lang.String |
readString()
Reads a java.lang.String.
|
protected abstract java.lang.String |
readUTF() |
protected abstract int inBytes(int numberOfBytesToRead) throws java.io.IOException
java.io.IOException
protected abstract byte getByte() throws java.io.IOException
java.io.IOException
protected abstract int getInt() throws java.io.IOException
java.io.IOException
protected abstract int getBytes(byte[] buf) throws java.io.IOException
java.io.IOException
protected abstract int getBytes(java.nio.ByteBuffer bBuf) throws java.io.IOException
java.io.IOException
protected abstract java.lang.String readUTF() throws java.io.IOException
java.io.IOException
public abstract void close() throws java.io.IOException
close
in interface JBaseObjectReader
java.io.IOException
public java.lang.Object readObject() throws java.io.IOException, java.lang.ClassNotFoundException
readObject
in interface JBaseObjectReader
java.io.IOException
java.lang.ClassNotFoundException
public JBaseSerializable readObject(JBaseSerializable o) throws java.io.IOException, java.lang.ClassNotFoundException
readObject
in interface JBaseObjectReader
java.io.IOException
java.lang.ClassNotFoundException
public IByteObject readObject(IByteObject o) throws java.io.IOException
readObject
in interface JBaseObjectReader
java.io.IOException
protected IByteObject readByteObject(char code, IByteObject o) throws java.io.IOException
java.io.IOException
protected java.nio.ByteBuffer checkBuffer(java.nio.ByteBuffer bBuf, int newDataLength)
protected JBaseSerializable readJBaseSerializableObject(char code, JBaseSerializable o) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
protected abstract ObjectFactory getObjectFactory() throws UnknownTypeException
UnknownTypeException
public int readInt() throws java.io.IOException
readInt
in interface JBaseObjectReader
java.io.IOException
public byte[] readBytes() throws java.io.IOException
readBytes
in interface JBaseObjectReader
java.io.IOException
public java.lang.String readString() throws java.io.IOException
readString
in interface JBaseObjectReader
java.io.IOException
public JBaseSerializable readRootObject() throws java.io.IOException, java.lang.ClassNotFoundException
JBaseObjectReader
readRootObject
in interface JBaseObjectReader
java.io.IOException
java.lang.ClassNotFoundException
protected int bufferedRead() throws java.io.IOException
java.io.IOException