Thursday, August 12, 2010

Java - Files and Streams Summary Part 2

1.6 File Streams


The classes FileInputStream and FileOutputStream define byte input and output streams that are connected to files.

FileInputStream(File file) - Creates a FileInputStream by opening a connection to an actual file, the file named by the File object file in the file system.

FileInputStream(String name) - Creates a FileInputStream by opening a connection to an actual file, the file named by the path name name in the file system.

FileInputStream(FileDescriptor fdObj) - Creates a FileInputStream by using the file descriptor fdObj, which represents an existing connection to an actual file in the file system.


FileOutputStream(File file) - Creates a file output stream to write to the file represented by the specified File object.


FileOutputStream(File file, boolean append) - Creates a file output stream to write to the file represented by the specified File object.


FileOutputStream(FileDescriptor fdObj) - Creates an output file stream to write to the specified file descriptor, which represents an existing connection to an actual file in the file system.


FileOutputStream(String name) - Creates an output file stream to write to the file with the specified name.


FileOutputStream(String name, boolean append) - Creates an output file stream to write to the file with the specified name.








No comments:

Post a Comment