edu.stanford.math.plex4.io
public class FileIOUtility extends java.lang.Object
Constructor and Description |
---|
FileIOUtility() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
loadObject(java.lang.String inputPath) |
static Table |
readCSVFile(java.lang.String filename,
java.lang.String separator,
boolean readTitle,
boolean readHeadings)
This function reads a CSV file and outputs the values into a Table
object.
|
static java.util.List<double[]> |
readNumericCSVFile(java.lang.String filename,
java.lang.String separator) |
static void |
saveImage(java.awt.image.BufferedImage image,
java.lang.String filePath)
Saves a BufferedImage stream in PNG format.
|
static void |
serializeObject(java.lang.Object obj,
java.lang.String destPath)
Try to save an object for quick reloading later.
|
static void |
writeTextFile(java.lang.String filePath,
java.lang.String contents,
boolean append)
This function saves a string to a text file.
|
public static void saveImage(java.awt.image.BufferedImage image, java.lang.String filePath) throws java.io.IOException
image
- the buffered image to save to diskfilePath
- the file to save the image file injava.io.IOException
public static void writeTextFile(java.lang.String filePath, java.lang.String contents, boolean append) throws java.io.IOException
filePath
- the path of the file to write tocontents
- a string holding the contents to writeappend
- if true, then the file will be appended tojava.io.IOException
public static Table readCSVFile(java.lang.String filename, java.lang.String separator, boolean readTitle, boolean readHeadings) throws java.io.IOException
filename
- the filename of the file to read fromseparator
- the separator between columnsreadTitle
- should be true iff the file contains a titlereadHeadings
- should be true iff the file contains the column headingsjava.io.IOException
public static java.util.List<double[]> readNumericCSVFile(java.lang.String filename, java.lang.String separator) throws java.io.IOException
java.io.IOException
public static void serializeObject(java.lang.Object obj, java.lang.String destPath) throws java.io.IOException
java.lang.Exception
java.io.IOException
public static java.lang.Object loadObject(java.lang.String inputPath) throws java.io.IOException
inputPath
- java.lang.Exception
java.io.IOException