system/io/BufferedReader.php
Convenience class for reading files.
- Access
- public
- Author
- Yannick Lecaillez
- Package
- phing.system.io
- See
- \FilterReader
- Version
- $Id$
\BufferedReader
Convenience class for reading files.
- Parent(s)
- \Reader
- See
- \FilterReader
- Access
- public
- Author
- Yannick Lecaillez
- Version
- $Id$
Properties
Methods


__construct(
object $reader, integer $buffsize
=
65536
)
:
void
Name | Type | Description |
---|---|---|
$reader | object | The reader (e.g. FileReader). |
$buffsize | integer | The size of the buffer we should use for reading files. A large buffer ensures that most files (all scripts?) are parsed in 1 buffer. |


close(
)
:
void
Close stream.
Exception | Description |
---|---|
\IOException | if there is an error closing stream |


eof(
)
:
boolean
Returns whether eof has been reached in stream.
This is important, because filters may want to know if the end of the file (and not just buffer) has been reached.
Type | Description |
---|---|
boolean |


getResource(
)
:
string
Returns the filename, url, etc. that is being read from.
This is critical for, e.g., ExpatParser's ability to know the filename that is throwing an ExpatParserException, etc.
Type | Description |
---|---|
string |


mark(
)
:
void
If supported, places a "marker" (like a bookmark) at current stream position.
Inherited from: \Reader::mark()A subsequent call to reset() will move stream position back to last marker (if supported).


read(
int $len
=
null
)
:
mixed
Reads and returns a chunk of data.
If length is specified, then only that number of chars is read, otherwise stream is read until EOF.
Name | Type | Description |
---|---|---|
$len | int | Number of bytes to read. Default is to read configured buffer size number of bytes. |
Type | Description |
---|---|
mixed | buffer or -1 if EOF. |


readChar(
)
:
string
Reads a single char from the reader.
Type | Description |
---|---|
string | single char or -1 if EOF. |