public function trim()
    {
        if (!isset($this->buffer[$this->bufferPos])) {
            $this->buffer = '';
        } else {
            $this->buffer = \substr($this->buffer, $this->bufferPos);
        }
        $this->bufferPos = 0;
    }