Wrapper class for PHP stream that supports read operations.

package phing.system.io

 Methods

Construct a new InputStream.

__construct(resource $stream) 

Parameters

$stream

resource

Configured PHP stream for writing.

Returns string representation of attached stream.

__toString() : string

Returns

string

Closes stream.

close() 

Exceptions

\IOException if stream cannot be closed (note that calling close() on an already-closed stream will not raise an exception)

Whether eof has been reached with stream.

eof() : boolean

Returns

boolean

Marks the current position in this input stream.

mark() 

Exceptions

\IOException - if the underlying stream doesn't support this method.

Whether the input stream supports mark and reset methods.

markSupported() : boolean

Returns

boolean

Read data from stream until $len chars or EOF.

read(int $len) : string

Parameters

$len

int

Num chars to read. If not specified this stream will read until EOF.

Returns

stringchars read or -1 if eof.

Reads a entire until EOF and places contents in passed-in variable.

readInto(string $rBuffer) : TRUE

Stream is closed after read.

author Charlie Killian, charlie@tizac.com
deprecated - Instead, use the read() method or a BufferedReader.

Parameters

$rBuffer

string

&$rBuffer String variable where read contents will be put.

Exceptions

\IOException - if there is an error reading from stream.

Returns

TRUEon success.

Repositions this stream to the position at the time the mark method was last called on this input stream.

reset() 

Exceptions

\IOException - if the underlying stream doesn't support this method.

Skip over $n bytes.

skip(int $n) 

Parameters

$n

int

 Properties

 

Position of stream cursor.

$currentPosition : int
 

Marked position of stream cursor.

$mark : int
 

The attached PHP stream.

$stream : resource