This class implements the OutputStream interface for writing bytes to a file.
More...
This class implements the OutputStream interface for writing bytes to a file.
- Since
- Qore 0.8.13
- Restrictions:
- Qore::PO_NO_FILESYSTEM
- Example: FileOutputStream basic usage
1 FileOutputStream fos(
"file.ext");
nothing Qore::FileOutputStream::close |
( |
| ) |
|
|
virtual |
Closes the output stream and releases any resources.
Any methods called on a closed output stream will throw an IO-ERROR exception.
- Exceptions
-
IO-ERROR | if an I/O error occurs |
Implements Qore::OutputStream.
Qore::FileOutputStream::constructor |
( |
string |
fileName, |
|
|
bool |
append = False , |
|
|
softint |
mode = 0666 |
|
) |
| |
Creates the FileOutputStream by opening or creating a file.
- Parameters
-
fileName | the name of the file to open |
append | if true, then bytes will be written to the end of the file |
mode | permission bits for when the file is to be created (default: 0666) |
nothing Qore::FileOutputStream::write |
( |
binary |
data | ) |
|
|
virtual |
Writes bytes to the output stream.
- Parameters
-
- Example:
1 FileOutputStream fos(
"file.ext");
- Exceptions
-
FILE-WRITE-ERROR | if an I/O error occurs |
Implements Qore::OutputStream.