# InputStream

Wrapper class for PHP stream that supports read operations.

package | phing.system.io

### Methods

## Construct a new InputStream.

    __construct(resource $stream)

throws |

### Arguments

#### $stream

`resource`

Configured PHP stream for writing.

## Returns string representation of attached stream.

    __toString() : string

### Response

`string`

## 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`

## 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`

## Read data from stream until $len chars or EOF.

    read(integer $len = null) : string

### Arguments

#### $len

`integer`

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

### Response

`string`

chars read or -1 if eof.

## 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.

## 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.

## Skip over $n bytes.

    skip(integer $n) : integer

### Arguments

#### $n

`integer`

### Response

`integer`

### Properties

## The attached PHP stream.

    stream : resource

var | The attached PHP stream.

### Type(s)

`resource`

## Position of stream cursor.

    currentPosition : integer

var | Position of stream cursor.

### Type(s)

`integer`

## Marked position of stream cursor.

    mark : integer

var | Marked position of stream cursor.

### Type(s)

`integer`