I/O's
Sequential Files

by Michael Thomas

(Tutorial Home Page)

by Michael Thomas

(Tutorial Home Page)

(not Completed)

File Class

Topic Notes
   
File Class
  • This object represents a single disk file or directory
  • The file this object represents does not need to exists.
  • The File class does not create files.  It can create a directory.
  • Filename parameter - may be relative or absolute.  If relative, the current default directory is used.  If absolute, the entire path from the root is used.
FileDialog
  • Not on the EXAM !
FileWriter
  • Not on EXAM!
   
   

Input/Output Streams

Topic Notes
   
FileInputStream & FileOutputStream
(Sequential Files)
  • FileOutputStream will create a file with 0 bytes.
  • FileInputStream will open a file.
  • Both have 3 constructors:  String, File, FileDiscriptor (aka file handle).
  • Inherited from InputStream & OutputStream
FilterInputStream &
FilterOutputStream
  • Inherits from InputStream / OutputStream
  • Superclass for:
    • BufferedInputStream / BufferedOutputStream
    • CheckedInputStream / CheckedOutputStream
    • DataInputStream / DataOutputStream
    • DigestInputStream / DigestOutputStream
    • InflaterInputStream / DeflaterOutputStream
    • LineNumberInputStream / DigestOutputStream both deprecated (use LineNumberReader)
    • PushbackInputStream / PrintStream
  •  
   
   

 

Input/Output Streams

Topic Notes
   
FileInputStream & FileOutputStream
(Sequential Files)
  • FileOutputStream will create a file with 0 bytes.
  • FileInputStream will open a file.
  • Both have 3 constructors:  String, File, FileDiscriptor (aka file handle).
  • Inherited from InputStream & OutputStream
FilterInputStream &
FilterOutputStream
  • Inherits from InputStream / OutputStream
  • Superclass for:
    • BufferedInputStream / BufferedOutputStream
    • CheckedInputStream / CheckedOutputStream
    • DataInputStream / DataOutputStream
    • DigestInputStream / DigestOutputStream
    • InflaterInputStream / DeflaterOutputStream
    • LineNumberInputStream / DigestOutputStream both deprecated (use LineNumberReader)
    • PushbackInputStream / PrintStream
  •  
   
   

Input/Output Stream Reader

Topic Notes
   
FileReader &
(Sequential Files)
  • Opens a file for reading characters.
  • Since it is subclassed from InputStreamReader you can use this class in the constructor of the InputStreamReader.
  • Has 3 constructors:  String, File, FileDiscriptor (aka file handle).

 

InputStreamReader
  • Reads from a byte stream and converts the data to a character stream.