net.sf.jameleon.util
Class InstanceSerializer

java.lang.Object
  extended by net.sf.jameleon.util.InstanceSerializer

public class InstanceSerializer
extends Object


Field Summary
static String SERIALIZED_EXT
          The file extension for serialized files
 
Method Summary
static Object deserialize(InputStream in)
          Deserializes an object from a given InputStream
static Object deserialize(String fileName)
          Deserializes an object from a given file name
static void serialize(Object obj, File file)
          Serializes a given object to a given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERIALIZED_EXT

public static final String SERIALIZED_EXT
The file extension for serialized files

See Also:
Constant Field Values
Method Detail

serialize

public static void serialize(Object obj,
                             File file)
                      throws IOException
Serializes a given object to a given file.

Parameters:
obj - - the object to serialize
file - - the file to serialize the object to
Throws:
IOException - if the file can't be serialized

deserialize

public static Object deserialize(String fileName)
                          throws IOException,
                                 ClassNotFoundException
Deserializes an object from a given file name

Parameters:
fileName - - A String representing the location of the serialized file
Throws:
IOException - - If the file can not be deserialzed
ClassNotFoundException - - If a class corresponding to the serialized file is not in the Classpath

deserialize

public static Object deserialize(InputStream in)
                          throws IOException,
                                 ClassNotFoundException
Deserializes an object from a given InputStream

Parameters:
in - - An InputStream representing a serialized file.
Throws:
IOException - - If the file can not be deserialzed
ClassNotFoundException - - If a class corresponding to the serialized file is not in the Classpath


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.