com.eriksilkensen.util
Class IOUtilities

java.lang.Object
  extended by com.eriksilkensen.util.IOUtilities

public class IOUtilities
extends java.lang.Object

Provides a set of i/o utility methods.

Since:
1.0.3
Version:
03/06/07
Author:
Erik Silkensen

Method Summary
static java.lang.Object deserializeObject(java.lang.String path)
          Deserializes the Object found at the path.
static java.lang.Object[] deserializeObject(java.lang.String path, int numObj)
          Deserializes all of the Objects found at the path.
static void serializeObject(java.io.Serializable[] obj, java.lang.String path)
          Serializes the Serializable[] obj, saving it in a file at the path.
static void serializeObject(java.io.Serializable obj, java.lang.String path)
          Serializes the Serializable obj, saving it in a file at the path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

serializeObject

public static void serializeObject(java.io.Serializable obj,
                                   java.lang.String path)
                            throws java.io.IOException
Serializes the Serializable obj, saving it in a file at the path.

Parameters:
obj - the Serializable to be serialized
path - the path for the .ser file
Throws:
java.io.IOException

serializeObject

public static void serializeObject(java.io.Serializable[] obj,
                                   java.lang.String path)
                            throws java.io.IOException
Serializes the Serializable[] obj, saving it in a file at the path.

Parameters:
obj - the Serializable[] to be serialized
path - the path for the .ser file
Throws:
java.io.IOException

deserializeObject

public static java.lang.Object deserializeObject(java.lang.String path)
                                          throws java.io.IOException,
                                                 java.lang.ClassNotFoundException
Deserializes the Object found at the path.

Parameters:
path - the path for the .ser file
Throws:
java.io.IOException
java.lang.ClassNotFoundException

deserializeObject

public static java.lang.Object[] deserializeObject(java.lang.String path,
                                                   int numObj)
                                            throws java.io.IOException,
                                                   java.lang.ClassNotFoundException
Deserializes all of the Objects found at the path.

Parameters:
path - the path for the .ser file
numObj - the number of Objects to deserialize
Throws:
java.io.IOException
java.lang.ClassNotFoundException