public function getBuffer()
    {
        $currentPos = $this->getPosition();
        $this->setPosition(0, SEEK_SET);
        $buffer = stream_get_contents($this->stream);
        $this->setPosition($currentPos, SEEK_SET);
        return $buffer;
    }