SSJ
V. 2.6.2.

Package umontreal.iro.lecuyer.util.io

This package provides tools for exporting data to text and binary files, as well as for importing data from files.

See:
          Description

Interface Summary
DataReader Data reader interface.
DataWriter Data writer interface.
 

Class Summary
AbstractDataReader This abstract class implements shared functionality for data readers.
AbstractDataWriter This abstract class implements shared functionality for data writers.
BinaryDataReader Binary data reader.
BinaryDataWriter Binary data writer.
CachedDataWriter This abstract class implements shared functionality for data writers that store all fields in memory before outputing them with close.
DataField This class represents a data field from a file read by an instance of a class implementing DataReader.
TextDataWriter Text data writer.
 

Enum Summary
TextDataWriter.Format Output format: organize fields as columns or as rows.
 

Package umontreal.iro.lecuyer.util.io Description

This package provides tools for exporting data to text and binary files, as well as for importing data from files.

Each of the write() methods takes a field label as their first argument. This label can always be set to null, in which case an anonymous field will be written. The write() methods that take one-dimensional array argument can also take an additional integer argument, for convenience, to specify the number of elements to write in the array.

For a quick start, consult the following examples and the documentation for umontreal.iro.lecuyer.util.ioDataWriter and umontreal.iro.lecuyer.util.ioDataReader, as well as the constructors of implementing classes (umontreal.iro.lecuyer.util.ioTextDataWriter, umontreal.iro.lecuyer.util.ioBinaryDataWriter and umontreal.iro.lecuyer.util.ioBinaryDataReader).

Example of how to write data to a file:


\begin{vcode}
\par
public static void writerExample() throws IOException {
Stri...
...l, 24);
out.write(null, 39);
out.write(null, 116);
out.close();
}
\end{vcode}

Example of how to read data from a file -- specific fields:


\begin{vcode}
\par
public static void readerExample1() throws IOException {
Str...
...m.out.print('' '' + n[i]);
System.out.println();
\par
in.close();
}
\end{vcode}

Example of how to read data from a file -- list all fields:


\begin{vcode}
\par
public static void readerExample2() throws IOException {
Str...
...
System.out.print('' '' + a[i]);
}
\par
System.out.println();
}
}
\end{vcode}


SSJ
V. 2.6.2.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.