From f6eb259fa5d39859266e5cc64ca0fce74fa54d5c Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Wed, 19 Mar 2003 12:13:41 +0000 Subject: 2003-03-19 Michael Koch * java/io/FileOutputStream.java (FileOutputStream): New constructor, merged from classpath. * java/io/FileWriter.java (FileWriter): New constructor, merged from classpath. From-SVN: r64574 --- libjava/java/io/FileOutputStream.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libjava/java/io/FileOutputStream.java') 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 FileOutputStream object to write + * to the specified File 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 append parameter is + * false. Otherwise bytes are written at the end of the + * file. + *

+ * Before opening a file, a security check is performed by calling the + * checkWrite method of the SecurityManager (if + * one exists) with the name of the file to be opened. An exception is + * thrown if writing is not allowed. + * + * @param file The File object this stream should write to + * @param append true to append bytes to the end of the file, + * or false 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 { -- cgit v1.1