@@ 446-454 (lines=9) @@ | ||
443 | * @param integer $o Offset |
|
444 | * @return string|false |
|
445 | */ |
|
446 | public function lookExact($n, $o = 0) { |
|
447 | if (!isset($this->bev)) { |
|
448 | return false; |
|
449 | } |
|
450 | if ($o + $n > $this->bev->input->length) { |
|
451 | return false; |
|
452 | } |
|
453 | return $this->bev->input->substr($o, $n); |
|
454 | } |
|
455 | ||
456 | /** |
|
457 | * Prepends data to input buffer |
|
@@ 486-494 (lines=9) @@ | ||
483 | * @param integer $o Offset |
|
484 | * @return string|false |
|
485 | */ |
|
486 | public function look($n, $o = 0) { |
|
487 | if (!isset($this->bev)) { |
|
488 | return false; |
|
489 | } |
|
490 | if ($this->bev->input->length <= $o) { |
|
491 | return ''; |
|
492 | } |
|
493 | return $this->bev->input->substr($o, $n); |
|
494 | } |
|
495 | ||
496 | /** |
|
497 | * Read from buffer without draining |
|
@@ 897-906 (lines=10) @@ | ||
894 | * Reads all data from the connection's buffer |
|
895 | * @return string Readed data |
|
896 | */ |
|
897 | public function readUnlimited() { |
|
898 | if (!isset($this->bev)) { |
|
899 | return false; |
|
900 | } |
|
901 | $read = $this->bev->read($this->bev->input->length); |
|
902 | if ($read === null) { |
|
903 | return false; |
|
904 | } |
|
905 | return $read; |
|
906 | } |
|
907 | } |
|
908 |