PHP Class BufferedReader, symfony-1.4

Inheritance: extends Reader
Show file Open project: vjousse/symfony-1.4 Class Usage Examples

Public Methods

Method Description
__construct ( Reader $reader, integer $buffsize = 65536 )
close ( )
eof ( ) : boolean Returns whether eof has been reached in stream.
getResource ( )
open ( )
read ( integer $len = null ) : mixed Reads and returns a chunk of data.
readChar ( ) : string Reads a single char from the reader.
readLine ( ) Read a line from input stream.
reset ( )
skip ( $n )

Method Details

__construct() public method

public __construct ( Reader $reader, integer $buffsize = 65536 )
$reader Reader 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() public method

public close ( )

eof() public method

This is important, because filters may want to know if the end of the file (and not just buffer) has been reached.
public eof ( ) : boolean
return boolean

getResource() public method

public getResource ( )

open() public method

public open ( )

read() public method

Reads and returns a chunk of data.
public read ( integer $len = null ) : mixed
$len integer Number of bytes to read. Default is to read configured buffer size number of bytes.
return mixed buffer or -1 if EOF.

readChar() public method

Reads a single char from the reader.
public readChar ( ) : string
return string single char or -1 if EOF.

readLine() public method

Read a line from input stream.
public readLine ( )

reset() public method

public reset ( )

skip() public method

public skip ( $n )