public function getContents()
    {
        $encoder = $this->getEncoder();
        $output = '';

        while ($encoder->valid()) {
            $output .= $encoder->current();
            $encoder->next();
        }

        $this->cursor += strlen($output);
        $this->buffer = null;

        return $output;
    }