Wrapper class for PHP stream that supports write operations.

package | phing.system.io

### Methods

## Construct a new OutputStream.

    __construct(resource $stream)

### Parameters

#### $stream

`resource`

Configured PHP stream for writing.

## Returns a string representation of the attached PHP stream.

    __toString() : string

### Returns

`string`

## Closes attached stream, flushing output first.

    close() : void

### Exceptions

`\IOException` | if cannot close stream (note that attempting to close an already closed stream will not raise an IOException)

## Flushes stream.

    flush()

### Exceptions

`\IOException` | if unable to flush data (e.g. stream is not open).

## Writes data to stream.

    write(string $buf, int $off, int $len) : void

### Parameters

#### $buf

`string`

Binary/character data to write.

#### $off

`int`

(Optional) offset.

#### $len

`int`

(Optional) number of bytes/chars to write.

### Exceptions

`\IOException` | - if there is an error writing to stream

### Properties

## The configured PHP stream.

    $stream : resource