# BufferedInputStream Class Reference
[Various accompanying utilities]

Inheritance diagram for BufferedInputStream:
[legend]

List of all members.

## Public Member Functions

| __construct (InputStream $in)
| close ()
| isEof ()
| markSupported ()
| mark ()
| reset ()
| available ()
| setRunAheadBytes ($runAheadBytes)
| read ($count)
| reads a maximum of $length bytes

## Static Public Member Functions

static | create (InputStream $in)

## Private Attributes

| $runAheadBytes = 0
| $in = null
| $closed = false
| $buffer = null
| $bufferLength = 0
| $position = 0
| $markPosition = null

## Detailed Description

Definition at line 15 of file BufferedInputStream.class.php.

## Constructor & Destructor Documentation

BufferedInputStream::__construct | ( | InputStream $ | in | ) |

Definition at line 28 of file BufferedInputStream.class.php.

## Member Function Documentation

BufferedInputStream::available | ( |  | ) |

Reimplemented from InputStream.

Definition at line 81 of file BufferedInputStream.class.php.

Referenced by read().

BufferedInputStream::close | ( |  | ) |

Returns:
  BufferedInputStream

Reimplemented from InputStream.

Definition at line 44 of file BufferedInputStream.class.php.

static BufferedInputStream::create | ( | InputStream $ | in | ) | `[static]`

Returns:
  BufferedInputStream

Definition at line 36 of file BufferedInputStream.class.php.

BufferedInputStream::isEof | ( |  | ) |

Reimplemented from InputStream.

Definition at line 51 of file BufferedInputStream.class.php.

BufferedInputStream::mark | ( |  | ) |

Returns:
  BufferedInputStream

Reimplemented from InputStream.

Definition at line 64 of file BufferedInputStream.class.php.

BufferedInputStream::markSupported | ( |  | ) |

Reimplemented from InputStream.

Definition at line 56 of file BufferedInputStream.class.php.

BufferedInputStream::read | ( | $ | length | ) |

reads a maximum of $length bytes

returns null on eof or if length == 0. Otherwise MUST return at least one byte or throw IOException

NOTE: if length is too large to read all data at once and eof has not been reached, it MUST BLOCK until all data is read or eof is reached or throw IOException.

It is abnormal state. Maybe you should use some kind of non-blocking channels instead?

Reimplemented from InputStream.

Definition at line 99 of file BufferedInputStream.class.php.

References available().

Here is the call graph for this function:

BufferedInputStream::reset | ( |  | ) |

Returns:
  BufferedInputStream

Reimplemented from InputStream.

Definition at line 74 of file BufferedInputStream.class.php.

BufferedInputStream::setRunAheadBytes | ( | $ | runAheadBytes | ) |

Returns:
  BufferedInputStream

Definition at line 92 of file BufferedInputStream.class.php.

References $runAheadBytes.

## Member Data Documentation

BufferedInputStream::$buffer = null`[private]`

Definition at line 22 of file BufferedInputStream.class.php.

BufferedInputStream::$bufferLength = 0`[private]`

Definition at line 23 of file BufferedInputStream.class.php.

BufferedInputStream::$closed = false`[private]`

Definition at line 20 of file BufferedInputStream.class.php.

BufferedInputStream::$in = null`[private]`

Definition at line 19 of file BufferedInputStream.class.php.

BufferedInputStream::$markPosition = null`[private]`

Definition at line 26 of file BufferedInputStream.class.php.

BufferedInputStream::$position = 0`[private]`

Definition at line 25 of file BufferedInputStream.class.php.

BufferedInputStream::$runAheadBytes = 0`[private]`

Definition at line 17 of file BufferedInputStream.class.php.

Referenced by setRunAheadBytes().

The documentation for this class was generated from the following file:

- main/Utils/IO/BufferedInputStream.class.php