public class SerializationHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SerializationHelper.ObjectInputStreamExt |
Constructor and Description |
---|
SerializationHelper() |
Modifier and Type | Method and Description |
---|---|
static Object |
deepClone(Object obj)
A deep copy makes a distinct copy of each of the object's fields, recursing through the
entire graph of other objects referenced by the object being copied.
|
static Object |
objectFromByteBuffer(byte[] buffer)
Creates an object from a byte buffer.
|
static byte[] |
objectToByteBuffer(Object obj)
Serializes an object into a byte buffer.
|
static Object |
readObject(byte[] data)
Read an Object from a byte array
|
static Object |
readObject(InputStream in)
read an object from an InputStream
|
static byte[] |
writeObject(Object object)
Serialize an Object to a ByteArray
|
static void |
writeObject(OutputStream out,
Object obj)
Write an Object to an OutputStream
|
public static byte[] writeObject(Object object) throws IOException
IOException
public static Object readObject(byte[] data) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static Object readObject(InputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static Object objectFromByteBuffer(byte[] buffer) throws Exception
Exception
public static byte[] objectToByteBuffer(Object obj) throws Exception
Exception
public static Object deepClone(Object obj)
obj
- the object to clone, the object and object context must implement
java.io.Serializable.IllegalArgumentException
- Failed to perform deep clone. The object of the context
object is not implements java.io.Serializable.public static void writeObject(OutputStream out, Object obj) throws IOException
IOException
Copyright © GigaSpaces.