system/io/FileInputStream.php
Input stream subclass for file streams.
- Package
- phing.system.io
\FileInputStream
Package: phing\system\io
Input stream subclass for file streams.
- Parent(s)
- \InputStream
Properties


int
$currentPosition= '0'
inheritedPosition of stream cursor.Inherited from:
\InputStream::$$currentPosition
Default value
0
Details- Type
- int
- Inherited_from
- \InputStream::$$currentPosition


int
$mark= '0'
inheritedMarked position of stream cursor.Inherited from:
\InputStream::$$mark
Default value
0
Details- Type
- int
- Inherited_from
- \InputStream::$$mark


resource
$stream= ''
inheritedThe attached PHP stream.Inherited from:
\InputStream::$$stream
Details
- Type
- resource
- Inherited_from
- \InputStream::$$stream
Methods


__construct(
\PhingFile | string $file, boolean $append
=
false
)
:
void
Construct a new FileInputStream.
Parameters
Throws
Name | Type | Description |
---|---|---|
$file | \PhingFile | string | Path to the file |
$append | boolean | Whether to append (ignored) |
Exception | Description |
---|---|
\Exception | - if invalid argument specified. |
\IOException | - if unable to open file. |


__toString(
)
:
string
Returns a string representation of the attached file.
Returns
Type | Description |
---|---|
string |


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


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


markSupported(
)
:
boolean
Mark is supported by FileInputStream.
Returns
Type | Description |
---|---|
boolean | TRUE |


read(
int $len
=
null
)
:
string
Parameters
Returns
Name | Type | Description |
---|---|---|
$len | int | Num chars to read. If not specified this stream will read until EOF. |
Type | Description |
---|---|
string | chars read or -1 if eof. |


readInto(
string $rBuffer
)
:
TRUE
inherited
Reads a entire until EOF and places contents in passed-in variable. Stream is closed after read.
Inherited from: \InputStream::readInto()
Parameters
Returns
Throws
Details
Name | Type | Description |
---|---|---|
$rBuffer | string | &$rBuffer String variable where read contents will be put. |
Type | Description |
---|---|
TRUE | on success. |
Exception | Description |
---|---|
\IOException | - if there is an error reading from stream. |
- Author
- Charlie Killian, charlie@tizac.com


reset(
)
:
void
inherited
Repositions this stream to the position at the time the mark method was last called on this input stream.
Inherited from: \InputStream::reset()
Throws
Exception | Description |
---|---|
\IOException | - if the underlying stream doesn't support this method. |