< prev index next >

src/java.base/share/classes/java/io/FileOutputStream.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -110,14 +110,14 @@
      * @implSpec Invoking this constructor with the parameter {@code name} is
      * equivalent to invoking {@link #FileOutputStream(String,boolean)
      * new FileOutputStream(name, false)}.
      *
      * @param      name   the system-dependent filename
-     * @exception  FileNotFoundException  if the file exists but is a directory
+     * @throws     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
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *               <code>checkWrite</code> method denies write access
      *               to the file.
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)
      */
     public FileOutputStream(String name) throws FileNotFoundException {

@@ -139,14 +139,14 @@
      * reason then a <code>FileNotFoundException</code> is thrown.
      *
      * @param     name        the system-dependent file name
      * @param     append      if <code>true</code>, then bytes will be written
      *                   to the end of the file rather than the beginning
-     * @exception  FileNotFoundException  if the file exists but is a directory
+     * @throws     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.
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *               <code>checkWrite</code> method denies write access
      *               to the file.
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)
      * @since     1.1
      */

@@ -169,14 +169,14 @@
      * 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 <code>FileNotFoundException</code> is thrown.
      *
      * @param      file               the file to be opened for writing.
-     * @exception  FileNotFoundException  if the file exists but is a directory
+     * @throws     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
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *               <code>checkWrite</code> method denies write access
      *               to the file.
      * @see        java.io.File#getPath()
      * @see        java.lang.SecurityException
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)

@@ -201,14 +201,14 @@
      * reason then a <code>FileNotFoundException</code> is thrown.
      *
      * @param      file               the file to be opened for writing.
      * @param     append      if <code>true</code>, then bytes will be written
      *                   to the end of the file rather than the beginning
-     * @exception  FileNotFoundException  if the file exists but is a directory
+     * @throws     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
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *               <code>checkWrite</code> method denies write access
      *               to the file.
      * @see        java.io.File#getPath()
      * @see        java.lang.SecurityException
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)

@@ -252,11 +252,11 @@
      * is {@link java.io.FileDescriptor#valid() invalid}.
      * However, if the methods are invoked on the resulting stream to attempt
      * I/O on the stream, an <code>IOException</code> is thrown.
      *
      * @param      fdObj   the file descriptor to be opened for writing
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *               <code>checkWrite</code> method denies
      *               write access to the file descriptor
      * @see        java.lang.SecurityManager#checkWrite(java.io.FileDescriptor)
      */
     public FileOutputStream(FileDescriptor fdObj) {

@@ -304,11 +304,11 @@
     /**
      * Writes the specified byte to this file output stream. Implements
      * the <code>write</code> method of <code>OutputStream</code>.
      *
      * @param      b   the byte to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      */
     public void write(int b) throws IOException {
         write(b, fdAccess.getAppend(fd));
     }
 

@@ -317,21 +317,21 @@
      * @param b the data to be written
      * @param off the start offset in the data
      * @param len the number of bytes that are written
      * @param append {@code true} to first advance the position to the
      *     end of file
-     * @exception IOException If an I/O error has occurred.
+     * @throws    IOException If an I/O error has occurred.
      */
     private native void writeBytes(byte b[], int off, int len, boolean append)
         throws IOException;
 
     /**
      * Writes <code>b.length</code> bytes from the specified byte array
      * to this file output stream.
      *
      * @param      b   the data.
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      */
     public void write(byte b[]) throws IOException {
         writeBytes(b, 0, b.length, fdAccess.getAppend(fd));
     }
 

@@ -340,11 +340,11 @@
      * starting at offset <code>off</code> to this file output stream.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
      * @param      len   the number of bytes to write.
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      */
     public void write(byte b[], int off, int len) throws IOException {
         writeBytes(b, off, len, fdAccess.getAppend(fd));
     }
 

@@ -362,11 +362,11 @@
      * Do not depend on finalization to invoke {@code close};
      * finalization is not reliable and is deprecated.
      * If cleanup of native resources is needed, other mechanisms such as
      * {@linkplain java.lang.ref.Cleaner} should be used.
      *
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      *
      * @revised 1.4
      * @spec JSR-51
      */
     public void close() throws IOException {

@@ -399,11 +399,11 @@
      *
      * @return  the <code>FileDescriptor</code> object that represents
      *          the connection to the file in the file system being used
      *          by this <code>FileOutputStream</code> object.
      *
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FileDescriptor
      */
      public final FileDescriptor getFD()  throws IOException {
         if (fd != null) {
             return fd;
< prev index next >