Package org.jppf.serialization
Class JPPFSerializationHelper
java.lang.Object
org.jppf.serialization.JPPFSerializationHelper
A collection of static utility methods to help with serialization in JPPF.
- Author:
- Laurent Cohen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectSerialize the an object from the specified stream, according to the configured serialization scheme.static ObjectdeserializeFromBytes(byte[] bytes, int offset, int len) Desrialize an object from an array of bytes.static voidserialize(Object object, OutputStream os) Serialize the specified object to the specified stream, according to the configured serialization scheme.static byte[]serializeToBytes(Object object) Serialize an object to an array of bytes.
-
Constructor Details
-
JPPFSerializationHelper
public JPPFSerializationHelper()
-
-
Method Details
-
serialize
Serialize the specified object to the specified stream, according to the configured serialization scheme.- Parameters:
object- the object to serialize.os- the outout stream to serialize to.- Throws:
Exception- if any error occurs during the serialization.
-
serializeToBytes
Serialize an object to an array of bytes.- Parameters:
object- the object to serialize.- Returns:
- an array of byte containing the serialized object, starting at position 0 and with no unused position.
- Throws:
Exception- if any error occurs during the serialization.
-
deserialize
Serialize the an object from the specified stream, according to the configured serialization scheme.- Parameters:
is- the input stream to deserialize from.- Returns:
- a deserialized object.
- Throws:
Exception- if any error occurs during the deserialization.
-
deserializeFromBytes
Desrialize an object from an array of bytes.- Parameters:
bytes- the bytes to deserialize from.offset- the position at which to start reading in the array.len- the number of bytes to read.- Returns:
- a deserialized object.
- Throws:
Exception- if any error occurs during the deserialization.
-