|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esotericsoftware.kryo.ObjectBuffer
public class ObjectBuffer
Serializes objects to and from byte arrays and streams.
This class uses a buffer internally and is not thread safe.
| Constructor Summary | |
|---|---|
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)
|
|
| Method Summary | ||
|---|---|---|
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. |
|
|
readObject(byte[] objectBytes,
java.lang.Class<T> type)
|
|
|
readObject(java.io.InputStream input,
java.lang.Class<T> type)
Reads to the end of the stream and returns the deserialized object. |
|
|
readObject(java.io.InputStream input,
int contentLength,
java.lang.Class<T> type)
Reads the specified number of bytes and returns the deserialized object. |
|
|
readObjectData(byte[] objectBytes,
java.lang.Class<T> type)
|
|
|
readObjectData(java.io.InputStream input,
java.lang.Class<T> type)
Reads to the end of the stream and returns the deserialized object. |
|
|
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)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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)
Kryo.readObjectData(ByteBuffer, Class)
public <T> T readObjectData(java.io.InputStream input,
int contentLength,
java.lang.Class<T> type)
Kryo.readObjectData(ByteBuffer, Class)
public void writeClassAndObject(java.io.OutputStream output,
java.lang.Object object)
Kryo.writeClassAndObject(ByteBuffer, 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)
Kryo.writeObjectData(ByteBuffer, 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)
Kryo.readObjectData(ByteBuffer, Class)public byte[] writeClassAndObject(java.lang.Object object)
Kryo.writeClassAndObject(ByteBuffer, Object)public byte[] writeObject(java.lang.Object object)
Kryo.writeObject(ByteBuffer, Object)public byte[] writeObjectData(java.lang.Object object)
Kryo.writeObjectData(ByteBuffer, Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||