# system/io/FileOutputStream.php

## \FileOutputStream
jump to top

Package: phing\system\io

Output stream subclass for file streams.

Parent(s)
  \OutputStream

### Properties

`\PhingFile $file= ''`

The associated file.
Details

Type
  \PhingFile

`resource $stream= ''`
inherited

The configured PHP stream.Inherited from: \OutputStream::$stream
Details

Type
  resource
Inherited_from
  \OutputStream::$stream

### Methods

`__construct( mixed $file, boolean $append = false ) : void`

Construct a new FileOutputStream.

Parameters

Name | Type | Description
--- | --- | ---
$file | mixed |
$append | boolean | Whether to append bytes to end of file rather than beginning.

Throws

Exception | Description
--- | ---
\Exception | - if invalid argument specified.
\IOException | - if unable to open file.

`__toString( ) : string`

Returns a string representation of the attached file.

Returns

Type | Description
--- | ---
string |

`close( ) : void`
inherited

Closes attached stream, flushing output first.

Inherited from: \OutputStream::close()
Throws

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

`flush( ) : void`
inherited

Flushes stream.

Inherited from: \OutputStream::flush()
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`
inherited

Writes data to stream.

Inherited from: \OutputStream::write()
Parameters

Name | Type | Description
--- | --- | ---
$buf | string | Binary/character data to write.
$off | int | (Optional) offset.
$len | int | (Optional) number of bytes/chars to write.

Throws

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

Documentation was generated by DocBlox 0.15.1.