phing-system-io
[ class tree: phing-system-io ] [ index: phing-system-io ] [ all elements ]

Class: BufferedReader

Source Location: /system/io/BufferedReader.php

Class Overview

Reader
   |
   --BufferedReader

Convenience class for reading files.


Author(s):

Version:

  • $Revision: 557 $ $Date: 2009-08-29 15:54:38 +0200 (Sat, 29 Aug 2009) $

Methods


Inherited Methods

Class: Reader

Reader::close()
Close stream.
Reader::getResource()
Returns the filename, url, etc. that is being read from.
Reader::mark()
If supported, places a "marker" (like a bookmark) at current stream position.
Reader::markSupported()
Whether marking is supported.
Reader::read()
Read data from source.
Reader::ready()
Is stream ready for reading.
Reader::reset()
Reset the current position in stream to beginning or last mark (if supported).
Reader::skip()
Move stream position relative to current pos.

Class Details

[line 33]
Convenience class for reading files.



Tags:

author:  <href="mailto:yl@seasonfive.com" a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
version:  $Revision: 557 $ $Date: 2009-08-29 15:54:38 +0200 (Sat, 29 Aug 2009) $
see:  FilterReader
access:  public


[ Top ]


Class Methods


constructor __construct [line 50]

BufferedReader __construct( Reader $reader, [integer $buffsize = 65536])



Parameters:

object   $reader   The reader (e.g. FileReader).
integer   $buffsize   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.

[ Top ]

method close [line 98]

void close( )



Overrides Reader::close() (Close stream.)

[ Top ]

method eof [line 161]

boolean eof( )

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.




[ Top ]

method getResource [line 165]

void getResource( )



Overrides Reader::getResource() (Returns the filename, url, etc. that is being read from.)

[ Top ]

method open [line 102]

void open( )



[ Top ]

method read [line 60]

mixed read( [int $len = null])

Reads and returns a chunk of data.



Tags:

return:  buffer or -1 if EOF.


Overrides Reader::read() (Read data from source.)

Parameters:

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

[ Top ]

method readChar [line 129]

string readChar( )

Reads a single char from the reader.



Tags:

return:  single char or -1 if EOF.


[ Top ]

method readLine [line 109]

void readLine( )

Read a line from input stream.



[ Top ]

method reset [line 94]

void reset( )



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

[ Top ]

method skip [line 90]

void skip( $n)



Overrides Reader::skip() (Move stream position relative to current pos.)

Parameters:

   $n  

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:50:25 +0200 by phpDocumentor 1.4.3