InputStream

Wrapper class for PHP stream that supports read operations.

package

phing.system.io

Methods

Construct a new InputStream.

__construct(resource $stream) 

Arguments

$stream

resource

Configured PHP stream for writing.

Skip over $n bytes.

skip(int $n) 

Arguments

$n

int

Read data from stream until $len chars or EOF.

read(int $len = null) : string

Arguments

$len

int

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

Response

string

chars read or -1 if eof.

Marks the current position in this input stream.

mark() 
throws
  • if the underlying stream doesn't support this method.

Whether the input stream supports mark and reset methods.

markSupported() : boolean

Response

boolean

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

reset() 
throws
  • if the underlying stream doesn't support this method.

Closes stream.

close() 
throws

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

Response

boolean

Reads a entire until EOF and places contents in passed-in variable. Stream is closed after read.

readInto($rBuffer) : TRUE
author

Charlie Killian, charlie@tizac.com

throws
  • if there is an error reading from stream.
deprecated
  • Instead, use the read() method or a BufferedReader.

Arguments

$rBuffer

Response

TRUE

on success.

Returns string representation of attached stream.

__toString() : string

Response

string

Properties

The attached PHP stream.

stream : resource
var

The attached PHP stream.

Type(s)

resource

Position of stream cursor.

currentPosition : int
var

Position of stream cursor.

Type(s)

int

Marked position of stream cursor.

mark : int
var

Marked position of stream cursor.

Type(s)

int