File Examples

Some of these examples have been discussed in class. The rest will be.

  1. TestFileClass, from the book, illustrates the use of the File class.
  2. WriteData, from the book, illustrates the use of PrintWriter.
  3. ReadData, from the book, illustrates the use of Scanner to read a text file.
  4. CopyFileByte, copies one file to another.
  5. CopyFileByteTwo, copies one file to another, using command line arguments to main.
  6. WriteFile, uses DataOutputStream.
  7. ReadFile, uses DataInputStream and reads what WriteFile wrote.
  8. ReadWriteFile, to be discussed Monday.