classes/phing/system/io/InputStream.php

Wrapper class for PHP stream that supports read operations.

package
phing.system.io

\InputStream

Wrapper class for PHP stream that supports read operations.

package
phing.system.io

Properties

Propertyprotectedint  $currentPosition= '0'

Position of stream cursor.
Default value0Details
Type
int
Propertyprotectedint  $mark= '0'

Marked position of stream cursor.
Default value0Details
Type
int
Propertyprotectedresource  $stream= ''

The attached PHP stream.
Details
Type
resource

Methods

methodpublic  __construct( resource $stream ) :
Construct a new InputStream.
Parameters
Name Type Description
$stream resource Configured PHP stream for writing.
methodpublic  __toString( ) : string
Returns string representation of attached stream.
Returns
Type Description
string
methodpublic  close( ) :
Closes stream.
Details
throws
if stream cannot be closed (note that calling close() on an already-closed stream will not raise an exception)
methodpublic  eof( ) : boolean
Whether eof has been reached with stream.
Returns
Type Description
boolean
methodpublic  mark( ) :
Marks the current position in this input stream.
Details
throws
- if the underlying stream doesn't support this method.
methodpublic  markSupported( ) : boolean
Whether the input stream supports mark and reset methods.
Returns
Type Description
boolean
methodpublic  read( int $len = null ) : string
Read data from stream until $len chars or EOF.
Parameters
Name Type Description
$len int Num chars to read. If not specified this stream will read until EOF.
Returns
Type Description
string
methodpublic  readInto( string $rBuffer ) : TRUE
Reads a entire until EOF and places contents in passed-in variable. Stream is closed after read.
Parameters
Name Type Description
$rBuffer string

&$rBuffer String variable where read contents will be put.

Returns
Type Description
TRUE
Details
author
Charlie Killian, charlie@tizac.com
deprecated
- Instead, use the read() method or a BufferedReader.
throws
- if there is an error reading from stream.
methodpublic  reset( ) :
Repositions this stream to the position at the time the mark method was last called on this input stream.
Details
throws
- if the underlying stream doesn't support this method.
methodpublic  skip( int $n ) :
Skip over $n bytes.
Parameters
Name Type Description
$n int
Documentation was generated by DocBlox 0.13.1.