# classes/phing/system/io/InputStream.php

Wrapper class for PHP stream that supports read operations.

package
  phing.system.io

## \InputStream
jump to top

Wrapper class for PHP stream that supports read operations.

package
  phing.system.io

### Properties

`int $currentPosition= '0'`

Position of stream cursor.
Default value `0` Details

Type
  int

`int $mark= '0'`

Marked position of stream cursor.
Default value `0` Details

Type
  int

`resource $stream= ''`

The attached PHP stream.
Details

Type
  resource

### Methods

`__construct( resource $stream ) :`
Construct a new InputStream.
Parameters

Name | Type | Description
--- | --- | ---
$stream | resource | Configured PHP stream for writing.

`__toString( ) : string`
Returns string representation of attached stream.
Returns

Type | Description
--- | ---
string |

`close( ) :`
Closes stream.
Details

throws
  if stream cannot be closed (note that calling close() on an already-closed stream will not raise an exception)

`eof( ) : boolean`
Whether eof has been reached with stream.
Returns

Type | Description
--- | ---
boolean |

`mark( ) :`
Marks the current position in this input stream.
Details

throws
  - if the underlying stream doesn't support this method.

`markSupported( ) : boolean`
Whether the input stream supports mark and reset methods.
Returns

Type | Description
--- | ---
boolean |

`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 |

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

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

`skip( int $n ) :`
Skip over $n bytes.
Parameters

Name | Type | Description
--- | --- | ---
$n | int |

Documentation was generated by DocBlox 0.13.1.