-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat: Add shouldReturnRawInputStream option to Get requests #872
Conversation
if (shouldReturnRawInputStream != null ) { | ||
req.setReturnRawInputStream(shouldReturnRawInputStream); | ||
} else { | ||
req.setReturnRawInputStream(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default value is different here so wondering how this will be reconciled.
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
@JesseLovelace Does it work also with |
@oripwk Should work with |
@JesseLovelace when is it going to be released? |
Good, I see it's on 1.116.0 |
Hi there, thanks for fixing this, unfortunately I haven't been able to make it work on my end. In Scala I'm trying to read files through a GZIPInputStream as follows:
Afterwards I'm wrapping it up in a GZIPInputStream to process it as follows:
Still, if I only use the InputStream it works, so it seems to me that the file is being downloaded decompressed, I thought the When I download the file from a different source (e.g. an SFTP server) where I know for sure no decompression is going on, wrapping it up in GZIPInputStream works properly. Has anybody had the same problem? Thanks! |
Hi @marioaae, Could you clarify the state of your object metadata? In certain cases GCS will decompress an object on response when |
Hi @frankyn, |
Adds support for shouldReturnRawInputStream, which will allow users to specify whether the client should auto-decompress gzipped content or not.
Note:
read(StorageObject, Map<Option, ?>, long, OutputStream)
andread(StorageObject, Map<Option, ?>, long, int)
in HttpStorageRpc are set up to have different defaults to preserve their original behavior. Before, returnRawInputStream was always set to true, howeverread(StorageObject, Map<Option, ?>, long, OutputStream)
had a bug that would cause that to be lost, so it would always turn out to be false (this is why blob.downloadTo and BlobReadChannel.read had different behaviors). That bug is fixed here, but these method signatures now have different defaults to preserve the original behavior. Users can use the new flag to change that behaviorFixes #321