Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » util » [javadoc | source]
org.hibernate.util
public final class: SerializationHelper [javadoc | source]
java.lang.Object
   org.hibernate.util.SerializationHelper

Assists with the serialization process and performs additional functionality based on serialization.

This class throws exceptions for invalid null inputs. Each method documents its behaviour in more detail.

Method from org.hibernate.util.SerializationHelper Summary:
clone,   deserialize,   deserialize,   serialize,   serialize
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.util.SerializationHelper Detail:
 public static Object clone(Serializable object) throws SerializationException 

    Deep clone an Object using serialization.

    This is many times slower than writing clone methods by hand on all objects in your object graph. However, for complex object graphs, or for those that don't support deep cloning this can be a simple alternative implementation. Of course all the objects must be Serializable.

 public static Object deserialize(InputStream inputStream) throws SerializationException 

    Deserializes an Object from the specified stream.

    The stream will be closed once the object is written. This avoids the need for a finally clause, and maybe also exception handling, in the application code.

    The stream passed in is not buffered internally within this method. This is the responsibility of your application if desired.

 public static Object deserialize(byte[] objectData) throws SerializationException 

    Deserializes a single Object from an array of bytes.

 public static byte[] serialize(Serializable obj) throws SerializationException 

    Serializes an Object to a byte array for storage/serialization.

 public static  void serialize(Serializable obj,
    OutputStream outputStream) throws SerializationException 

    Serializes an Object to the specified stream.

    The stream will be closed once the object is written. This avoids the need for a finally clause, and maybe also exception handling, in the application code.

    The stream passed in is not buffered internally within this method. This is the responsibility of your application if desired.