# FileOutputStream

Extends \OutputStream

Output stream subclass for file streams.

package | phing.system.io

### Methods

## Construct a new OutputStream.

    __construct(resource $stream)

inherited

throws |

### Arguments

#### $stream

`resource`

Configured PHP stream for writing.

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

    __toString() : string

inherited

### Response

`string`

## Closes attached stream, flushing output first.

    close() : void

inherited

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

## Flushes stream.

    flush()

inherited

throws | if unable to flush data (e.g. stream is not open).

## Writes data to stream.

    write(string $buf, integer $off = null, integer $len = null) : void

inherited

throws | if there is an error writing to stream

### Arguments

#### $buf

`string`

Binary/character data to write.

#### $off

`integer`

(Optional) offset.

#### $len

`integer`

(Optional) number of bytes/chars to write.

### Properties

## The associated file.

    file : \PhingFile

var | The associated file.

### Type(s)

`\PhingFile`

## The configured PHP stream.

    stream : resource

inherited

var | The configured PHP stream.

### Type(s)

`resource`