edu.cmu.minorthird.util
Class IOUtil

java.lang.Object
  extended by edu.cmu.minorthird.util.IOUtil

public class IOUtil
extends java.lang.Object

IO utilities.


Constructor Summary
IOUtil()
           
 
Method Summary
static java.io.Serializable loadSerialized(java.io.File file)
           
static java.io.Serializable loadSerialized(java.io.InputStream input)
           
static java.lang.String readFile(java.io.File in)
          Reads a file and converts it to a String via a byte array and inputStream.available() I'm not positive that inputStream.available() works the same under multi-threading
static void saveSerialized(java.io.Serializable obj, java.io.File file)
           
static boolean saveSomehow(java.lang.Object obj, java.io.File file)
           
static boolean saveSomehow(java.lang.Object obj, java.io.File file, boolean complainAboutProblems)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtil

public IOUtil()
Method Detail

saveSomehow

public static boolean saveSomehow(java.lang.Object obj,
                                  java.io.File file)

saveSomehow

public static boolean saveSomehow(java.lang.Object obj,
                                  java.io.File file,
                                  boolean complainAboutProblems)

saveSerialized

public static void saveSerialized(java.io.Serializable obj,
                                  java.io.File file)
                           throws java.io.IOException
Throws:
java.io.IOException

loadSerialized

public static java.io.Serializable loadSerialized(java.io.File file)
                                           throws java.io.IOException
Throws:
java.io.IOException

loadSerialized

public static java.io.Serializable loadSerialized(java.io.InputStream input)
                                           throws java.io.IOException
Throws:
java.io.IOException

readFile

public static java.lang.String readFile(java.io.File in)
                                 throws java.io.IOException
Reads a file and converts it to a String via a byte array and inputStream.available() I'm not positive that inputStream.available() works the same under multi-threading

Parameters:
in - - File object to read - should be character data
Returns:
String a string version of the data
Throws:
java.io.IOException