|
|||||||||
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 BufferedReader |
readReaderFromString(String textFileOrUrl,
String encoding)
|
static ObjectInputStream |
readStreamFromString(String filenameOrUrl)
|
static File |
writeObjectToFile(Object o,
File file)
Write an object to a specified File. |
static File |
writeObjectToFile(Object o,
String filename)
Write object to a file with the specified name. |
static File |
writeObjectToFileNoExceptions(Object o,
String filename)
Write object to a file with the specified name. |
static File |
writeObjectToTempFile(Object o,
String filename)
Write object to temp file which is destroyed when the program exits. |
static File |
writeObjectToTempFileNoExceptions(Object 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(Object o, String filename) throws IOException
o
- object to be written to filefilename
- name of the temp file
IOException
- If can't write file.public static File writeObjectToFile(Object o, File file) throws IOException
o
- object to be written to filefile
- The temp File
IOException
- If File cannot be writtenpublic static File writeObjectToFileNoExceptions(Object o, String filename)
o
- object to be written to filefilename
- name of the temp file
public static File writeObjectToTempFile(Object o, String filename) throws IOException
o
- object to be written to filefilename
- name of the temp file
IOException
- If file cannot be writtenpublic static File writeObjectToTempFileNoExceptions(Object 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
- If file cannot be read
ClassNotFoundException
- If reading serialized object failspublic static Object readObjectFromFile(String filename) throws IOException, ClassNotFoundException
filename
- The filename of the object to be retrived
IOException
- If file cannot be read
ClassNotFoundException
- If reading serialized object failspublic 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
public static BufferedReader readReaderFromString(String textFileOrUrl, String encoding) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |