system/io/FileOutputStream.php
Output stream subclass for file streams.
- Package
- phing.system.io
\FileOutputStream
Package: phing\system\io
Output stream subclass for file streams.
- Parent(s)
- \OutputStream
Properties

resource
$stream= ''
inheritedThe configured PHP stream.Inherited from:
\OutputStream::$$stream
Details
- Type
- resource
- Inherited_from
- \OutputStream::$$stream
Methods

__construct(
mixed $file, boolean $append
=
false
)
:
voidConstruct a new FileOutputStream.
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $file | mixed | |
| $append | boolean | Whether to append bytes to end of file rather than beginning. |
| Exception | Description |
|---|---|
| \Exception | - if invalid argument specified. |
| \IOException | - if unable to open file. |

__toString(
)
:
stringReturns a string representation of the attached file.
Returns
| Type | Description |
|---|---|
| string |

close(
)
:
void
Throws
| Exception | Description |
|---|---|
| \IOException | if cannot close stream (note that attempting to close an already closed stream will not raise an IOException) |

flush(
)
:
void
Throws
| Exception | Description |
|---|---|
| \IOException | if unable to flush data (e.g. stream is not open). |

write(
string $buf, int $off
=
null, int $len
=
null
)
:
void
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $buf | string | Binary/character data to write. |
| $off | int | (Optional) offset. |
| $len | int | (Optional) number of bytes/chars to write. |
| Exception | Description |
|---|---|
| \IOException | - if there is an error writing to stream |