-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added downloadAsStream method to StorageObject #199
Added downloadAsStream method to StorageObject #199
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
I like the thought of exposing the streams, but am concerned @Ged15 What are your thoughts on |
|
Please! :) Thanks for the quick response. |
67bd021
to
98e6fd1
Compare
@dwsupplee I also reused the |
This looks awesome. Thanks again @Ged15! |
This let's retrieve the body of the
StorageObject
as a stream. Inspired by PSR-7 response methodgetBody
. This method returns a PSR-7StreamInterface
which enables the user to decide whether they want to write stream to another stream or get the contents as a string.I also propose to remove
downloadAsString
anddownloadToFile
in the next major release since the functionality of these methods is easily achieved usinggetBody
and having the other methods can be confusing.