java.lang.Object | ||
↳ | java.io.OutputStream | |
↳ | com.neomades.io.file.FileOutputStream |
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.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates an output file stream to write to the file with the specified path.
path | the system-dependent file path |
---|
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.
path | the system-dependent file path |
---|---|
append | if true , then bytes will be written
|
Creates a file output stream to write to the file represented by the
specified File
object.
outputFile | the file to be opened for writing. |
---|
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.
outputFile | the file to be opened for writing. |
---|---|
append | if true , then bytes will be written
|
Writes the specified byte to this file output stream. Implements the
write
method of OutputStream
.
b | the byte to be written. |
---|
IOException | if an I/O error occurs. |
---|