FileOutputStream (Java Platform SE 7 ) (original) (raw)


public class FileOutputStream
extends OutputStream
A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether or not a file is available or may be created depends upon the underlying platform. Some platforms, in particular, allow a file to be opened for writing by only one
FileOutputStream
(or other file-writing object) at a time. In such situations the constructors in this class will fail if the file involved is already open.
FileOutputStream is meant for writing streams of raw bytes such as image data. For writing streams of characters, consider usingFileWriter.
Since:
JDK1.0
See Also:
File, FileDescriptor, FileInputStream, Files.newOutputStream(java.nio.file.Path, java.nio.file.OpenOption...)

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.