public function getContents()
    {
        if (is_null($this->stream) || ! $this->isReadable()) {
            $message = 'Could not get contents of stream';

            throw new \RuntimeException($message);
        }

        return stream_get_contents($this->stream);
    }