public class

FileOutputStream

extends OutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ com.neomades.io.file.FileOutputStream

Class Overview

A file output stream is an output stream for writing data to a File. 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.

Summary

Public Constructors
FileOutputStream(String path)
Creates an output file stream to write to the file with the specified path.
FileOutputStream(String path, boolean append)
Creates an output file stream to write to the file with the specified path.
FileOutputStream(File outputFile)
Creates a file output stream to write to the file represented by the specified File object.
FileOutputStream(File outputFile, boolean append)
Creates a file output stream to write to the file represented by the specified File object.
Public Methods
void write(int b)
Writes the specified byte to this file output stream.
[Expand]
Inherited Methods
From class java.io.OutputStream
From class java.lang.Object

Public Constructors

public FileOutputStream (String path)

Creates an output file stream to write to the file with the specified path.

Parameters
path the system-dependent file path

public FileOutputStream (String path, boolean append)

Creates an output file stream to write to the file with the specified path. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.

Parameters
path the system-dependent file path
append if true, then bytes will be written

public FileOutputStream (File outputFile)

Creates a file output stream to write to the file represented by the specified File object.

Parameters
outputFile the file to be opened for writing.

public FileOutputStream (File outputFile, boolean append)

Creates a file output stream to write to the file represented by the specified File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.

Parameters
outputFile the file to be opened for writing.
append if true, then bytes will be written

Public Methods

public void write (int b)

Writes the specified byte to this file output stream. Implements the write method of OutputStream.

Parameters
b the byte to be written.
Throws
IOException if an I/O error occurs.