Code Duplication    Length = 10-10 lines in 2 locations

PHPDaemon/Network/IOStream.php 2 locations

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