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

Print this page




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.io;
  27 
  28 import java.nio.channels.FileChannel;
  29 import java.util.concurrent.atomic.AtomicBoolean;
  30 import sun.misc.SharedSecrets;
  31 import sun.misc.JavaIOFileDescriptorAccess;
  32 import sun.nio.ch.FileChannelImpl;
  33 
  34 
  35 /**
  36  * A file output stream is an output stream for writing data to a
  37  * <code>File</code> or to a <code>FileDescriptor</code>. Whether or not
  38  * a file is available or may be created depends upon the underlying
  39  * platform.  Some platforms, in particular, allow a file to be opened
  40  * for writing by only one {@code FileOutputStream} (or other
  41  * file-writing object) at a time.  In such situations the constructors in
  42  * this class will fail if the file involved is already open.
  43  *
  44  * <p><code>FileOutputStream</code> is meant for writing streams of raw bytes
  45  * such as image data. For writing streams of characters, consider using
  46  * <code>FileWriter</code>.
  47  *
  48  * @author  Arthur van Hoff
  49  * @see     java.io.File
  50  * @see     java.io.FileDescriptor
  51  * @see     java.io.FileInputStream




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.io;
  27 
  28 import java.nio.channels.FileChannel;
  29 import java.util.concurrent.atomic.AtomicBoolean;
  30 import jdk.internal.misc.SharedSecrets;
  31 import jdk.internal.misc.JavaIOFileDescriptorAccess;
  32 import sun.nio.ch.FileChannelImpl;
  33 
  34 
  35 /**
  36  * A file output stream is an output stream for writing data to a
  37  * <code>File</code> or to a <code>FileDescriptor</code>. Whether or not
  38  * a file is available or may be created depends upon the underlying
  39  * platform.  Some platforms, in particular, allow a file to be opened
  40  * for writing by only one {@code FileOutputStream} (or other
  41  * file-writing object) at a time.  In such situations the constructors in
  42  * this class will fail if the file involved is already open.
  43  *
  44  * <p><code>FileOutputStream</code> is meant for writing streams of raw bytes
  45  * such as image data. For writing streams of characters, consider using
  46  * <code>FileWriter</code>.
  47  *
  48  * @author  Arthur van Hoff
  49  * @see     java.io.File
  50  * @see     java.io.FileDescriptor
  51  * @see     java.io.FileInputStream