system/io/BufferedReader.php

Show: inherited
Table of Contents

Convenience class for reading files.

Access
public  
Author
Yannick Lecaillez  
Package
phing.system.io  
See
\FilterReader  
Version
$Id$  

\BufferedReader

Package: phing\system\io

Convenience class for reading files.

Parent(s)
\Reader
See
\FilterReader  
Access
public  
Author
Yannick Lecaillez  
Version
$Id$  

Properties

Propertyprivate  $buffer= 'null'
Default valuenullDetails
Type
n/a
Propertyprivate  $bufferPos= '0'
Default value0Details
Type
n/a
Propertyprivate  $bufferSize= '0'
Default value0Details
Type
n/a
Propertyprivate  $in= ''

The Reader we are buffering for.

Details
Type
n/a

Methods

methodpublic__construct( object $reader, integer $buffsize = 65536 ) : void

Parameters
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.

methodpublicclose( ) : void

Close stream.

Throws
Exception Description
\IOException if there is an error closing stream
methodpubliceof( ) : 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.

Returns
Type Description
boolean
methodpublicgetResource( ) : 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.

Returns
Type Description
string
methodpublicmark( ) : void
inherited

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).

methodpublicmarkSupported( ) : boolean
inherited

Whether marking is supported.

Inherited from: \Reader::markSupported()
Returns
Type Description
boolean
methodpublicopen( ) : void

methodpublicread( 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.

Parameters
Name Type Description
$len int

Number of bytes to read. Default is to read configured buffer size number of bytes.

Returns
Type Description
mixed buffer or -1 if EOF.
methodpublicreadChar( ) : string

Reads a single char from the reader.

Returns
Type Description
string single char or -1 if EOF.
methodpublicreadLine( ) : void

Read a line from input stream.

methodpublicready( ) : boolean
inherited

Is stream ready for reading.

Inherited from: \Reader::ready()
Returns
Type Description
boolean
methodpublicreset( ) : void

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

methodpublicskip( int $n ) : void

Move stream position relative to current pos.

Parameters
Name Type Description
$n int
Documentation was generated by DocBlox 0.18.1.