OutputStream

Wrapper class for PHP stream that supports write operations.

package

phing.system.io

Methods

Construct a new OutputStream.

__construct(resource $stream) 

Arguments

$stream

resource

Configured PHP stream for writing.

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, int $off = null, int $len = null) : void
throws
  • if there is an error writing to stream

Arguments

$buf

string

Binary/character data to write.

$off

int

(Optional) offset.

$len

int

(Optional) number of bytes/chars to write.

Returns a string representation of the attached PHP stream.

__toString() : string

Response

string

Properties

The configured PHP stream.

stream : resource
var

The configured PHP stream.

Type(s)

resource