aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io/FileOutputStream.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-03-19 12:13:41 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-03-19 12:13:41 +0000
commitf6eb259fa5d39859266e5cc64ca0fce74fa54d5c (patch)
tree0dcf614afa94acb02e8af772cc7a0aae73972cc1 /libjava/java/io/FileOutputStream.java
parent31488c64a711d6d61caecd2718a751535dec7eaa (diff)
downloadgcc-f6eb259fa5d39859266e5cc64ca0fce74fa54d5c.zip
gcc-f6eb259fa5d39859266e5cc64ca0fce74fa54d5c.tar.gz
gcc-f6eb259fa5d39859266e5cc64ca0fce74fa54d5c.tar.bz2
2003-03-19 Michael Koch <konqueror@gmx.de>
* java/io/FileOutputStream.java (FileOutputStream): New constructor, merged from classpath. * java/io/FileWriter.java (FileWriter): New constructor, merged from classpath. From-SVN: r64574
Diffstat (limited to 'libjava/java/io/FileOutputStream.java')
-rw-r--r--libjava/java/io/FileOutputStream.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/libjava/java/io/FileOutputStream.java b/libjava/java/io/FileOutputStream.java
index 5ea24e5..eee3449 100644
--- a/libjava/java/io/FileOutputStream.java
+++ b/libjava/java/io/FileOutputStream.java
@@ -47,6 +47,32 @@ public class FileOutputStream extends OutputStream
this (file.getPath(), false);
}
+ /**
+ * This method initializes a <code>FileOutputStream</code> object to write
+ * to the specified <code>File</code> object. The file is created if it
+ * does not exist, and the bytes written are written starting at the
+ * beginning of the file if the <code>append</code> parameter is
+ * <code>false</code>. Otherwise bytes are written at the end of the
+ * file.
+ * <p>
+ * Before opening a file, a security check is performed by calling the
+ * <code>checkWrite</code> method of the <code>SecurityManager</code> (if
+ * one exists) with the name of the file to be opened. An exception is
+ * thrown if writing is not allowed.
+ *
+ * @param file The <code>File</code> object this stream should write to
+ * @param append <code>true</code> to append bytes to the end of the file,
+ * or <code>false</code> to write bytes to the beginning
+ *
+ * @exception SecurityException If write access to the file is not allowed
+ * @exception FileNotFoundException If a non-security error occurs
+ */
+ public
+ FileOutputStream(File file, boolean append) throws FileNotFoundException
+ {
+ this(file.getPath(), append);
+ }
+
public FileOutputStream (FileDescriptor fdObj)
throws SecurityException
{