Creates a file output stream to write to the file with the specified
name. If the second argument is true, then
bytes will be written to the end of the file rather than the beginning.
A new FileDescriptor object is created to represent this
file connection.
First, if there is a security manager, its checkWrite
method is called with name as its argument.
If the file exists but is a directory rather than a regular file, does
not exist but cannot be created, or cannot be opened for any other
reason then a FileNotFoundException is thrown.
name | the system-dependent file name | |
append | if true, then bytes will be written
to the end of the file rather than the beginning |
FileNotFoundException | if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason. | |
SecurityException | if a security manager exists and its
checkWrite method denies write access
to the file. |
java.lang.SecurityManager.checkWrite(java.lang.String)
Diagram: OutputStream