112 |
|
|
113 |
/** |
/** |
114 |
* This method initializes a <code>FileOutputStream</code> object to write |
* This method initializes a <code>FileOutputStream</code> object to write |
115 |
|
* to the specified <code>File</code> object. The file is created if it |
116 |
|
* does not exist, and the bytes written are written starting at the |
117 |
|
* beginning of the file if the <code>append</code> parameter is |
118 |
|
* <code>false</code>. Otherwise bytes are written at the end of the |
119 |
|
* file. |
120 |
|
* <p> |
121 |
|
* Before opening a file, a security check is performed by calling the |
122 |
|
* <code>checkWrite</code> method of the <code>SecurityManager</code> (if |
123 |
|
* one exists) with the name of the file to be opened. An exception is |
124 |
|
* thrown if writing is not allowed. |
125 |
|
* |
126 |
|
* @param file The <code>File</code> object this stream should write to |
127 |
|
* @param append <code>true</code> to append bytes to the end of the file, |
128 |
|
* or <code>false</code> to write bytes to the beginning |
129 |
|
* |
130 |
|
* @exception SecurityException If write access to the file is not allowed |
131 |
|
* @exception FileNotFoundException If a non-security error occurs |
132 |
|
*/ |
133 |
|
public |
134 |
|
FileOutputStream(File file, boolean append) throws FileNotFoundException |
135 |
|
{ |
136 |
|
this(file.getPath(), append); |
137 |
|
} |
138 |
|
|
139 |
|
/*************************************************************************/ |
140 |
|
|
141 |
|
/** |
142 |
|
* This method initializes a <code>FileOutputStream</code> object to write |
143 |
* to the named file. The file is created if it does not exist, and |
* to the named file. The file is created if it does not exist, and |
144 |
* the bytes written are written starting at the beginning of the file if |
* the bytes written are written starting at the beginning of the file if |
145 |
* the <code>append</code> argument is <code>false</code> or at the end |
* the <code>append</code> argument is <code>false</code> or at the end |