Send feedback
Cloud Storage Client - Class HashValidatingStream (2.3.0) Stay organized with collections
Save and categorize content based on your preferences.
2.3.0 (latest)
2.2.0
2.1.0
2.0.0
1.51.0
1.50.0
1.49.2
1.48.7
1.47.0
1.46.0
1.45.0
1.44.0
1.43.1
1.42.1
1.41.4
1.37.0
1.36.1
1.35.0
1.34.0
1.33.4
1.32.0
1.31.2
1.30.3
Reference documentation and code samples for the Cloud Storage Client class HashValidatingStream.
A Guzzle stream decorator that computes CRC32C and MD5 hashes on the fly
and validates them when the end of the stream is reached.
Namespace
Google \ Cloud \ Storage
Methods
__construct
stream
Psr\Http\Message\StreamInterface
The underlying stream to wrap.
options
array
Configuration options.
↳ expectedCrc32c
string
Base64-encoded expected CRC32C checksum.
↳ expectedMd5
string
Base64-encoded expected MD5 checksum.
isSeekable
Validating streams are not seekable since hash calculations are done on-the-fly.
seek
Seek operations are not supported on validating streams.
read
Read from the stream and update hash calculations.
getContents
Get the entire remaining contents of the stream and validate.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-03 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-03 UTC."],[],[]]