OutputStream

Wrapper class for PHP stream that supports write operations.

package

phing.system.io

Methods

Construct a new OutputStream.

__construct(resource $stream) 
throws

Arguments

$stream

resource

Configured PHP stream for writing.

Returns a string representation of the attached PHP stream.

__toString() : string

Response

string

Closes attached stream, flushing output first.

close() : void
throws

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

Flushes stream.

flush() 
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
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 configured PHP stream.

stream : resource
var

The configured PHP stream.

Type(s)

resource