Package org.jppf.comm.socket
Class BootstrapObjectSerializer
java.lang.Object
org.jppf.comm.socket.BootstrapObjectSerializer
- All Implemented Interfaces:
ObjectSerializer
This serializer is used solely by the nodes to enable their bootstrapping.
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor must be public to allow for instantiation through Java reflection. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(byte[] bytes) Read an object from an array of bytes.deserialize(byte[] bytes, int offset, int length) Read an object from an array of bytes.Read an object from an input stream.deserialize(InputStream is, boolean closeStream) Read an object from an input stream.deserialize(JPPFBuffer buf) Read an object from an array of bytes.Serialize an object into an array of bytes.Serialize an object into an array of bytes.voidserialize(Object o, OutputStream os) Serialize an object into an output stream.voidserialize(Object o, OutputStream os, boolean closeStream) Serialize an object into an output stream.
-
Constructor Details
-
BootstrapObjectSerializer
public BootstrapObjectSerializer()The default constructor must be public to allow for instantiation through Java reflection.
-
-
Method Details
-
serialize
Serialize an object into an array of bytes.- Specified by:
serializein interfaceObjectSerializer- Parameters:
o- the object to Serialize.- Returns:
- a
JPPFBufferinstance holding the serialized object. - Throws:
Exception- if the object can't be serialized.
-
serialize
Serialize an object into an array of bytes.- Specified by:
serializein interfaceObjectSerializer- Parameters:
o- the object to Serialize.noCopy- avoid copying intermediate buffers.- Returns:
- a
JPPFBufferinstance holding the serialized object. - Throws:
Exception- if the object can't be serialized.
-
serialize
Serialize an object into an output stream.- Specified by:
serializein interfaceObjectSerializer- Parameters:
o- the object to Serialize.os- the output stream to serialize to.- Throws:
Exception- if the object can't be serialized.
-
serialize
Serialize an object into an output stream.- Parameters:
o- the object to Serialize.os- the output stream to serialize to.closeStream- whether to close the stream before returning.- Throws:
Exception- if the object can't be serialized.
-
deserialize
Read an object from an array of bytes.- Specified by:
deserializein interfaceObjectSerializer- Parameters:
buf- buffer holding the array of bytes to deserialize from.- Returns:
- the object that was deserialized from the array of bytes.
- Throws:
Exception- if the ObjectInputStream used for deserialization raises an error.
-
deserialize
Read an object from an array of bytes.- Specified by:
deserializein interfaceObjectSerializer- Parameters:
bytes- buffer holding the array of bytes to deserialize from.- Returns:
- the object that was deserialized from the array of bytes.
- Throws:
Exception- if the ObjectInputStream used for deserialization raises an error.
-
deserialize
Read an object from an array of bytes.- Specified by:
deserializein interfaceObjectSerializer- Parameters:
bytes- buffer holding the array of bytes to deserialize from.offset- position at which to start reading the bytes from.length- the number of bytes to read.- Returns:
- the object that was deserialized from the array of bytes.
- Throws:
Exception- if the ObjectInputStream used for deserialization raises an error.
-
deserialize
Read an object from an input stream.- Specified by:
deserializein interfaceObjectSerializer- Parameters:
is- the input stream to deserialize from.- Returns:
- the object that was deserialized from the array of bytes.
- Throws:
Exception- if the ObjectInputStream used for deserialization raises an error.
-
deserialize
Read an object from an input stream.- Parameters:
is- the input stream to deserialize from.closeStream- whether to close the stream before returning.- Returns:
- the object that was deserialized from the array of bytes.
- Throws:
Exception- if the ObjectInputStream used for deserialization raises an error.
-