Kraken\Util\Buffer\Buffer::peek PHP Method

peek() public method

public peek ( $length, $offset )
    public function peek($length = 0, $offset = 0)
    {
        $length = (int) $length;
        if (0 > $length) {
            return '';
        } else {
            if (0 === $length) {
                return $this->data;
            }
        }
        $offset = (int) $offset;
        if (0 > $offset) {
            $offset = 0;
        }
        if (0 === $offset && strlen($this->data) <= $length) {
            return $this->data;
        }
        $result = (string) substr($this->data, $offset, $length);
        return $result;
    }