public function getContents()
    {
        if (!$this->isReadable() || ($contents = stream_get_contents($this->fp, -1, 0)) === false) {
            throw new \RuntimeException('Unable to get contents of stream');
        }

        return $contents;
    }