downloadAsStream() public method

Example: $stream = $object->downloadAsStream(); echo $stream->getContents();
public downloadAsStream ( array $options = [] ) : Psr\Http\Message\StreamInterface
$options array [optional] { Configuration Options. @type string $encryptionKey An AES-256 customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKeySHA256`. @type string $encryptionKeySHA256 The SHA256 hash of the customer-supplied encryption key. It will be neccesary to provide this when a key was used during the object's creation. If provided one must also include an `encryptionKey`. }
return Psr\Http\Message\StreamInterface
 public function testGetBodyWithExtraOptions()
 {
     $key = base64_encode('abcd');
     $hash = base64_encode('1234');
     $bucket = 'bucket';
     $object = 'object.txt';
     $stream = Psr7\stream_for($string = 'abcdefg');
     $this->connection->downloadObject(['bucket' => $bucket, 'object' => $object, 'generation' => null, 'httpOptions' => ['headers' => ['x-goog-encryption-algorithm' => 'AES256', 'x-goog-encryption-key' => $key, 'x-goog-encryption-key-sha256' => $hash]]])->willReturn($stream);
     $object = new StorageObject($this->connection->reveal(), $object, $bucket);
     $body = $object->downloadAsStream(['encryptionKey' => $key, 'encryptionKeySHA256' => $hash]);
     $this->assertInstanceOf(StreamInterface::class, $body);
     $this->assertEquals($string, $body);
 }