public class ObjectBuffer
extends java.lang.Object
Constructor and Description |
---|
ObjectBuffer(Kryo kryo)
Creates an ObjectStream with an initial buffer size of 2KB and a maximum size of 16KB.
|
ObjectBuffer(Kryo kryo,
int maxCapacity) |
ObjectBuffer(Kryo kryo,
int initialCapacity,
int maxCapacity) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
readClassAndObject(byte[] objectBytes) |
java.lang.Object |
readClassAndObject(java.io.InputStream input)
Reads to the end of the stream and returns the deserialized object.
|
java.lang.Object |
readClassAndObject(java.io.InputStream input,
int contentLength)
Reads the specified number of bytes and returns the deserialized object.
|
<T> T |
readObject(byte[] objectBytes,
java.lang.Class<T> type) |
<T> T |
readObject(java.io.InputStream input,
java.lang.Class<T> type)
Reads to the end of the stream and returns the deserialized object.
|
<T> T |
readObject(java.io.InputStream input,
int contentLength,
java.lang.Class<T> type)
Reads the specified number of bytes and returns the deserialized object.
|
<T> T |
readObjectData(byte[] objectBytes,
java.lang.Class<T> type) |
<T> T |
readObjectData(java.io.InputStream input,
java.lang.Class<T> type)
Reads to the end of the stream and returns the deserialized object.
|
<T> T |
readObjectData(java.io.InputStream input,
int contentLength,
java.lang.Class<T> type)
Reads the specified number of bytes and returns the deserialized object.
|
void |
setKryo(Kryo kryo) |
byte[] |
writeClassAndObject(java.lang.Object object) |
void |
writeClassAndObject(java.io.OutputStream output,
java.lang.Object object) |
byte[] |
writeObject(java.lang.Object object) |
void |
writeObject(java.io.OutputStream output,
java.lang.Object object) |
byte[] |
writeObjectData(java.lang.Object object) |
void |
writeObjectData(java.io.OutputStream output,
java.lang.Object object) |
public ObjectBuffer(Kryo kryo)
public ObjectBuffer(Kryo kryo, int maxCapacity)
maxCapacity
- The initial and maximum size in bytes of an object that can be read or written.ObjectBuffer(Kryo, int, int)
public ObjectBuffer(Kryo kryo, int initialCapacity, int maxCapacity)
initialCapacity
- The initial maximum size in bytes of an object that can be read or written.maxCapacity
- The maximum size in bytes of an object that can be read or written. The capacity is doubled until the
maxCapacity is exceeded, then SerializationException is thrown by the read and write methods.public void setKryo(Kryo kryo)
public java.lang.Object readClassAndObject(java.io.InputStream input)
Kryo.readClassAndObject(ByteBuffer)
public java.lang.Object readClassAndObject(java.io.InputStream input, int contentLength)
Kryo.readClassAndObject(ByteBuffer)
public <T> T readObject(java.io.InputStream input, java.lang.Class<T> type)
Kryo.readObject(ByteBuffer, Class)
public <T> T readObject(java.io.InputStream input, int contentLength, java.lang.Class<T> type)
Kryo.readObject(ByteBuffer, Class)
public <T> T readObjectData(java.io.InputStream input, java.lang.Class<T> type)
public <T> T readObjectData(java.io.InputStream input, int contentLength, java.lang.Class<T> type)
public void writeClassAndObject(java.io.OutputStream output, java.lang.Object object)
public void writeObject(java.io.OutputStream output, java.lang.Object object)
Kryo.writeObject(ByteBuffer, Object)
public void writeObjectData(java.io.OutputStream output, java.lang.Object object)
public java.lang.Object readClassAndObject(byte[] objectBytes)
Kryo.readClassAndObject(ByteBuffer)
public <T> T readObject(byte[] objectBytes, java.lang.Class<T> type)
Kryo.readObject(ByteBuffer, Class)
public <T> T readObjectData(byte[] objectBytes, java.lang.Class<T> type)
public byte[] writeClassAndObject(java.lang.Object object)
public byte[] writeObject(java.lang.Object object)
Kryo.writeObject(ByteBuffer, Object)
public byte[] writeObjectData(java.lang.Object object)