# FileReader

Extends \InputStreamReader

Convenience class for reading files.

Unlike the Java counterpart, this class does not (yet) handle character set transformations. This will be an important function of this class with move to supporting PHP6.

package | phing.system.io

### Methods

## Construct a new FileReader.

    __construct(mixed $file)

### Arguments

#### $file

`mixed`

PhingFile or string pathname.

## Close stream.

    close()

inherited abstract

throws | if there is an error closing stream

## Whether eof has been reached with stream.

    eof() : boolean

inherited

### Response

`boolean`

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

    getResource() : string

inherited 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()

inherited

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

## Whether marking is supported.

    markSupported() : boolean

inherited

### Response

`boolean`

## Read data from source.

    read(integer $len = null)

inherited abstract

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

### Arguments

#### $len

`integer`

## Reads a entire file and stores the data in the variable passed by reference.

    readInto( &$rBuffer) : boolean

inherited

author | Charlie Killian, charlie@tizac.com
deprecated | Use read() or BufferedReader instead.

### Arguments

#### $rBuffer

``

### Response

`boolean`

TRUE on success. Err object on failure.

## Is stream ready for reading.

    ready() : boolean

inherited

### Response

`boolean`

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

    reset()

inherited

## Move stream position relative to current pos.

    skip(integer $n)

inherited

### Arguments

#### $n

`integer`

### Properties

## inStream

    inStream : \InputStream

inherited

var |

### Type(s)

`\InputStream`