summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-05-27 17:33:11 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-27 17:33:11 -0700
commit83b734febd08784905d257d533df1b201937ecfd (patch)
tree5e71416da6c5227340e368de5382f367bc995c2d /luni
parentecf950e56b55f95a960f151268286576159c6530 (diff)
parent5722fb8a3c56310ad3e9394e7bd9bb0fd17917a9 (diff)
downloadlibcore-83b734febd08784905d257d533df1b201937ecfd.zip
libcore-83b734febd08784905d257d533df1b201937ecfd.tar.gz
libcore-83b734febd08784905d257d533df1b201937ecfd.tar.bz2
am 5722fb8a: Fix the FileOutputStream documentation.
* commit '5722fb8a3c56310ad3e9394e7bd9bb0fd17917a9': Fix the FileOutputStream documentation.
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/io/FileOutputStream.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/luni/src/main/java/java/io/FileOutputStream.java b/luni/src/main/java/java/io/FileOutputStream.java
index cc57571..69f9235 100644
--- a/luni/src/main/java/java/io/FileOutputStream.java
+++ b/luni/src/main/java/java/io/FileOutputStream.java
@@ -66,9 +66,9 @@ public class FileOutputStream extends OutputStream implements Closeable {
private final CloseGuard guard = CloseGuard.get();
/**
- * Constructs a new {@code FileOutputStream} that writes to {@code file}.
+ * Constructs a new {@code FileOutputStream} that writes to {@code file}. The file will be
+ * truncated if it exists, and created if it doesn't exist.
*
- * @param file the file to which this stream writes.
* @throws FileNotFoundException if file cannot be opened for writing.
*/
public FileOutputStream(File file) throws FileNotFoundException {
@@ -76,12 +76,10 @@ public class FileOutputStream extends OutputStream implements Closeable {
}
/**
- * Constructs a new {@code FileOutputStream} that writes to {@code file},
- * creating it if necessary. If {@code append} is true and the file already
- * exists, it will be appended to. Otherwise a new file will be created.
+ * Constructs a new {@code FileOutputStream} that writes to {@code file}.
+ * If {@code append} is true and the file already exists, it will be appended to; otherwise
+ * it will be truncated. The file will be created if it does not exist.
*
- * @param file the file to which this stream writes.
- * @param append true to append to an existing file.
* @throws FileNotFoundException if the file cannot be opened for writing.
*/
public FileOutputStream(File file, boolean append) throws FileNotFoundException {
@@ -97,7 +95,6 @@ public class FileOutputStream extends OutputStream implements Closeable {
/**
* Constructs a new {@code FileOutputStream} that writes to {@code fd}.
*
- * @param fd the FileDescriptor to which this stream writes.
* @throws NullPointerException if {@code fd} is null.
*/
public FileOutputStream(FileDescriptor fd) {
@@ -113,14 +110,21 @@ public class FileOutputStream extends OutputStream implements Closeable {
}
/**
- * Equivalent to {@code new FileOutputStream(new File(path), false)}.
+ * Constructs a new {@code FileOutputStream} that writes to {@code path}. The file will be
+ * truncated if it exists, and created if it doesn't exist.
+ *
+ * @throws FileNotFoundException if file cannot be opened for writing.
*/
public FileOutputStream(String path) throws FileNotFoundException {
this(path, false);
}
/**
- * Equivalent to {@code new FileOutputStream(new File(path), append)}.
+ * Constructs a new {@code FileOutputStream} that writes to {@code path}.
+ * If {@code append} is true and the file already exists, it will be appended to; otherwise
+ * it will be truncated. The file will be created if it does not exist.
+ *
+ * @throws FileNotFoundException if the file cannot be opened for writing.
*/
public FileOutputStream(String path, boolean append) throws FileNotFoundException {
this(new File(path), append);