public function getObjectAsString(
        $bucketName,
        $key,
        $options = array()
    ) {
        $outputStream = fopen('php://memory', 'r+');
        try {
            $this->getObject($bucketName, $key, $outputStream, $options);
            rewind($outputStream);
            $result = stream_get_contents($outputStream);
            if (is_resource($outputStream)) {
                fclose($outputStream);
            }
            return $result;
        } catch (\Exception $e) {
            if (is_resource($outputStream)) {
                fclose($outputStream);
            }
            throw $e;
        }
    }