system/io/InputStream.php

Show: inherited
Table of Contents

Wrapper class for PHP stream that supports read operations.

Package
phing.system.io  

\InputStream

Package: phing\system\io

Wrapper class for PHP stream that supports read operations.

Children
\FileInputStream

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 ) : void

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
methodpublicclose( ) : void

Closes stream.

Throws
Exception Description
\IOException if stream cannot be closed (note that calling close() on an already-closed stream will not raise an exception)
methodpubliceof( ) : boolean

Whether eof has been reached with stream.

Returns
Type Description
boolean
methodpublicmark( ) : void

Marks the current position in this input stream.

Throws
Exception Description
\IOException - if the underlying stream doesn't support this method.
methodpublicmarkSupported( ) : boolean

Whether the input stream supports mark and reset methods.

Returns
Type Description
boolean
methodpublicread( 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 chars read or -1 if eof.
methodpublicreadInto( 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 on success.
Throws
Exception Description
\IOException - if there is an error reading from stream.
Details
Author
Charlie Killian, charlie@tizac.com  
Deprecated
- Instead, use the read() method or a BufferedReader.  
methodpublicreset( ) : void

Repositions this stream to the position at the time the mark method was last called on this input stream.

Throws
Exception Description
\IOException - if the underlying stream doesn't support this method.
methodpublicskip( int $n ) : void

Skip over $n bytes.

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