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.12
- Restrictions:
- Qore::PO_NO_FILESYSTEM
- Example: FileOutputStream basic usage
1 FileOutputStream fos(
"file.ext");
nothing Qore::FileOutputStream::bulkWrite |
( |
binary |
data, |
|
|
timeout |
timeout_ms = -1 |
|
) |
| |
|
virtual |
Writes bytes to the input stream.
- Parameters
-
data | the data to write |
timeout_ms | ignored |
- Example:
1 FileOutputStream fos(
"file.ext");
- Exceptions
-
FILE-WRITE-ERROR | if an I/O error occurs |
Implements Qore::OutputStream.
nothing Qore::FileOutputStream::close |
( |
| ) |
|
|
virtual |
Closes the output stream and releases any resources.
Any methods called on a closed output stream will thrown an IO-ERROR exception.
- Exceptions
-
IO-ERROR | if an I/O error occurs |
Implements Qore::OutputStream.
Qore::FileOutputStream::constructor |
( |
string |
fileName, |
|
|
bool |
append = False |
|
) |
| |
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 |
nothing Qore::FileOutputStream::write |
( |
int |
value, |
|
|
timeout |
timeout_ms = -1 |
|
) |
| |
|
virtual |
Writes a single byte to the output stream.
- Parameters
-
value | the byte (0 - 255) to write to the output stream, only the least significant 8 bits are used, the rest is ignored |
timeout_ms | ignored |
- Example:
1 FileOutputStream fos(
"file.ext");
- Exceptions
-
FILE-WRITE-ERROR | if an I/O error occurs |
Implements Qore::OutputStream.