mdsj

Class IO


public class IO
extends java.lang.Object

Functionality for reading and writing files. Provides functionality for reading and writing data matrices from files and to files or the standard output.

Method Summary

static double[][]
read(String filename)
Reads a data matrix from a file into a two-dimensional array.
static void
write(double[][] data, String filename)
Writes a data matrix to a file.
static void
writeStandardOut(double[][] data)
Writes a data matrix to a the standard output

Method Details

read

public static double[][] read(String filename)
            throws Exception
Reads a data matrix from a file into a two-dimensional array.
Parameters:
filename - path to the input data matrix
Returns:
data matrix as a two-dimensional array

write

public static void write(double[][] data,
                         String filename)
            throws Exception
Writes a data matrix to a file.
Parameters:
data - data matrix to be written
filename - path to the output file

writeStandardOut

public static void writeStandardOut(double[][] data)
            throws Exception
Writes a data matrix to a the standard output
Parameters:
data - data matrix to be written