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
author Hans Lellelid
author Yannick Lecaillez
version $Id$

 Methods

Construct a new FileReader.

__construct(mixed $file) 

Parameters

$file

mixed

PhingFile or string pathname.

Close the stream.

close() 
Inherited
inherited_from \InputStreamReader::close()

Exceptions

\IOException if there is an error closing stream

Whether eof has been reached with stream.

eof() : boolean
Inherited
inherited_from \InputStreamReader::eof()

Returns

boolean

Returns string representation of attached stream.

getResource() : string
Inherited

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

inherited_from \InputStreamReader::getResource()

Returns

string

Marks the current position in this input stream.

mark() 
Inherited

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

inherited_from \InputStreamReader::mark()

Exceptions

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

Whether the attached stream supports mark/reset.

markSupported() : boolean
Inherited
inherited_from \InputStreamReader::markSupported()

Returns

boolean

Read data from file.

read(int $len) : string
Inherited

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

inherited_from \InputStreamReader::read()

Parameters

$len

int

Num chars to read.

Returns

stringchars read or -1 if eof.

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

readInto($rBuffer) : TRUE
Inherited
author Charlie Killian, charlie@tizac.com
inherited_from \InputStreamReader::readInto()

Parameters

$rBuffer

Returns

TRUEon success. Err object on failure.

Is stream ready for reading.

ready() : boolean
Inherited
inherited_from \Reader::ready()
inherited_from \InputStreamReader::ready()

Returns

boolean

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

reset() 
Inherited
inherited_from \InputStreamReader::reset()

Exceptions

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

Skip over $n bytes.

skip(int $n) 
Inherited
inherited_from \InputStreamReader::skip()

Parameters

$n

int

 Properties

 

$inStream : \InputStream
Inherited
inherited_from \InputStreamReader::$$inStream