+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | H | e | l | l | | W | o | r | l | d | . | . | . | ....... +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ ^ | file pointer |
The file pointer is set to the start of the file (first character) when the file is opened.
public DataFile(String fname)
Constructor.
Opens the file `fname' so you can read/write the file
|
|
DataFile myFile;
myFile = new DataFile( "student-file" ); // Open the file named "student-file"
|
|
|
|
cd /home/cs377001/demo/Phys-Data-Dependance/file0
|
writeIntFile.java Writes 4 integers to file "datafile"
readIntFile.java Read 4 integers to file "datafile"
and print the values as decimal numbers
readIntFile2.java Read 4 integers to file "datafile"
and print the values as hexa-decimal numbers
|
writeCharFile.java Writes 4 strings to file "datafile"
readCharFile.java Read 4 strings to file "datafile"
and print them out
Run: dump-bin < datafile // Show content of "datafile" as binary numbers
dump-hex < datafile // Show content of "datafile" as hexadec numbers
|
|