| 1 | <?php |
||
| 18 | class Reader |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var StreamInterface |
||
| 22 | */ |
||
| 23 | protected $stream; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Create reader object |
||
| 27 | * |
||
| 28 | * @throws Exception\InvalidArgumentException An exception will be thrown for non-readable streams |
||
| 29 | * |
||
| 30 | * @param StreamInterface $stream |
||
| 31 | */ |
||
| 32 | public function __construct(StreamInterface $stream) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get stream |
||
| 43 | * |
||
| 44 | * @return StreamInterface |
||
| 45 | */ |
||
| 46 | public function getStream() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Read up to $length number of bytes of data from the stream |
||
| 53 | * |
||
| 54 | * @param int $length The maximum number of bytes to read |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function read($length) |
||
| 62 | } |
||
| 63 |