org.jppf.comm.socket
Class BootstrapObjectSerializer

java.lang.Object
  extended by org.jppf.comm.socket.BootstrapObjectSerializer
All Implemented Interfaces:
ObjectSerializer

public class BootstrapObjectSerializer
extends Object
implements ObjectSerializer

This serializer is used solely by the nodes to enable their bootstrapping.

Author:
Laurent Cohen

Constructor Summary
BootstrapObjectSerializer()
          The default constructor must be public to allow for instantiation through Java reflection.
 
Method Summary
 Object deserialize(byte[] bytes)
          Read an object from an array of bytes.
 Object deserialize(byte[] bytes, int offset, int length)
          Read an object from an array of bytes.
 Object deserialize(InputStream is)
          Read an object from an input stream.
 Object deserialize(JPPFBuffer buf)
          Read an object from an array of bytes.
 JPPFBuffer serialize(Object o)
          Serialize an object into an array of bytes.
 JPPFBuffer serialize(Object o, boolean noCopy)
          Serialize an object into an array of bytes.
 void serialize(Object o, OutputStream os)
          Serialize an object into an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootstrapObjectSerializer

public BootstrapObjectSerializer()
The default constructor must be public to allow for instantiation through Java reflection.

Method Detail

serialize

public JPPFBuffer serialize(Object o)
                     throws Exception
Serialize an object into an array of bytes.

Specified by:
serialize in interface ObjectSerializer
Parameters:
o - the object to Serialize.
Returns:
a JPPFBuffer instance holding the serialized object.
Throws:
Exception - if the object can't be serialized.
See Also:
ObjectSerializer.serialize(java.lang.Object)

serialize

public JPPFBuffer serialize(Object o,
                            boolean noCopy)
                     throws Exception
Serialize an object into an array of bytes.

Specified by:
serialize in interface ObjectSerializer
Parameters:
o - the object to Serialize.
noCopy - avoid copying intermediate buffers.
Returns:
a JPPFBuffer instance holding the serialized object.
Throws:
Exception - if the object can't be serialized.
See Also:
ObjectSerializer.serialize(java.lang.Object)

serialize

public void serialize(Object o,
                      OutputStream os)
               throws Exception
Serialize an object into an output stream.

Specified by:
serialize in interface ObjectSerializer
Parameters:
o - - the object to Serialize.
os - - the output stream to serialize to.
Throws:
Exception - if the object can't be serialized.
See Also:
ObjectSerializer.serialize(java.lang.Object, java.io.OutputStream)

deserialize

public Object deserialize(JPPFBuffer buf)
                   throws Exception
Read an object from an array of bytes.

Specified by:
deserialize in interface ObjectSerializer
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.
See Also:
ObjectSerializer.deserialize(org.jppf.utils.JPPFBuffer)

deserialize

public Object deserialize(byte[] bytes)
                   throws Exception
Read an object from an array of bytes.

Specified by:
deserialize in interface ObjectSerializer
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.
See Also:
ObjectSerializer.deserialize(byte[])

deserialize

public Object deserialize(byte[] bytes,
                          int offset,
                          int length)
                   throws Exception
Read an object from an array of bytes.

Specified by:
deserialize in interface ObjectSerializer
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.
See Also:
ObjectSerializer.deserialize(byte[], int, int)

deserialize

public Object deserialize(InputStream is)
                   throws Exception
Read an object from an input stream.

Specified by:
deserialize in interface ObjectSerializer
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.
See Also:
ObjectSerializer.deserialize(java.io.InputStream)


Copyright © 2005-2010 JPPF Team.