system/io/OutputStream.php
Wrapper class for PHP stream that supports write operations.
- Package
- phing.system.io
\OutputStream
Package: phing\system\io
Wrapper class for PHP stream that supports write operations.
- Children
- \FileOutputStream
Properties
Methods

__construct(
resource $stream
)
:
voidConstruct a new OutputStream.
Parameters
| Name | Type | Description |
|---|---|---|
| $stream | resource | Configured PHP stream for writing. |

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

close(
)
:
voidCloses attached stream, flushing output first.
Throws
| Exception | Description |
|---|---|
| \IOException | if cannot close stream (note that attempting to close an already closed stream will not raise an IOException) |

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

write(
string $buf, int $off
=
null, int $len
=
null
)
:
voidWrites data to stream.
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 |