# Reader

Abstract class for reading character streams.

author | Hans Lellelid hans@xmpl.org
author | Yannick Lecaillez yl@seasonfive.com
version | $Id: 7acaed79c1abfad8021979dc7c81d086dfb58e3a $
package | phing.system.io

### Methods

## Close stream.

    close()

abstract

throws | if there is an error closing stream

## Returns the filename, url, etc. that is being read from.

    getResource() : string

abstract

This is critical for, e.g., ExpatParser's ability to know the filename that is throwing an ExpatParserException, etc.

### Response

`string`

## If supported, places a "marker" (like a bookmark) at current stream position.

    mark()

A subsequent call to reset() will move stream position back to last marker (if supported).

## Whether marking is supported.

    markSupported() : boolean

### Response

`boolean`

## Read data from source.

    read(integer $len = null)

abstract

If length is specified, then only that number of chars is read, otherwise stream is read until EOF.

### Arguments

#### $len

`integer`

## Is stream ready for reading.

    ready() : boolean

### Response

`boolean`

## Reset the current position in stream to beginning or last mark (if supported).

    reset()

## Move stream position relative to current pos.

    skip(integer $n)

### Arguments

#### $n

`integer`