|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.io.IOUtils
public class IOUtils
Helper Class for storing serialized objects to disk.
Method Summary | |
---|---|
static int |
lineCount(File textFile)
|
static Object |
readObjectFromFile(File file)
Read an object from a stored file. |
static Object |
readObjectFromFile(String filename)
Read an object from a stored file. |
static Object |
readObjectFromFileNoExceptions(File file)
Read an object from a stored file without throwing exceptions. |
static BufferedReader |
readReaderFromString(String textFileOrUrl)
|
static ObjectInputStream |
readStreamFromString(String filenameOrUrl)
|
static File |
writeObjectToFile(Serializable o,
String filename)
Write object to a file with the specified name. |
static File |
writeObjectToFileNoExceptions(Serializable o,
String filename)
Write object to a file with the specified name. |
static File |
writeObjectToTempFile(Serializable o,
String filename)
Write object to temp file which is destroyed when the program exits. |
static File |
writeObjectToTempFileNoExceptions(Serializable o,
String filename)
Write object to a temp file and ignore exceptions. |
static ObjectOutputStream |
writeStreamFromString(String serializePath)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static File writeObjectToFile(Serializable o, String filename) throws IOException
o
- object to be written to filefilename
- name of the temp file
IOException
public static File writeObjectToFileNoExceptions(Serializable o, String filename)
o
- object to be written to filefilename
- name of the temp file
public static File writeObjectToTempFile(Serializable o, String filename) throws IOException
o
- object to be written to filefilename
- name of the temp file
IOException
public static File writeObjectToTempFileNoExceptions(Serializable o, String filename)
o
- object to be written to filefilename
- name of the temp file
public static Object readObjectFromFile(File file) throws IOException, ClassNotFoundException
file
- the file pointing to the object to be retrived
IOException
ClassNotFoundException
public static Object readObjectFromFile(String filename) throws IOException, ClassNotFoundException
filename
- The filename of the object to be retrived
IOException
ClassNotFoundException
public static Object readObjectFromFileNoExceptions(File file)
file
- the file pointing to the object to be retrived
public static int lineCount(File textFile) throws IOException
IOException
public static ObjectOutputStream writeStreamFromString(String serializePath) throws IOException
IOException
public static ObjectInputStream readStreamFromString(String filenameOrUrl) throws IOException
IOException
public static BufferedReader readReaderFromString(String textFileOrUrl) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |