Code Duplication    Length = 10-10 lines in 2 locations

PHPDaemon/Network/IOStream.php 2 locations

@@ 521-530 (lines=10) @@
518
     * @param integer $o Offset
519
     * @return string|false
520
     */
521
    public function look($n, $o = 0)
522
    {
523
        if (!isset($this->bev)) {
524
            return false;
525
        }
526
        if ($this->bev->input->length <= $o) {
527
            return '';
528
        }
529
        return $this->bev->input->substr($o, $n);
530
    }
531
532
    /**
533
     * Read from buffer without draining
@@ 563-572 (lines=10) @@
560
     * @param  integer $n Number of bytes to read
561
     * @return string|false
562
     */
563
    public function readExact($n)
564
    {
565
        if ($n === 0) {
566
            return '';
567
        }
568
        if (!$this->bev || $this->bev->input->length < $n) {
569
            return false;
570
        }
571
        return $this->read($n);
572
    }
573
574
    /**
575
     * Returns length of input buffer