Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions google/cloud/storage/examples/storage_object_samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ void ReadObjectIntoMemory(google::cloud::storage::Client client,
[](gcs::Client client, std::string const& bucket_name,
std::string const& object_name) {
gcs::ObjectReadStream stream = client.ReadObject(bucket_name, object_name);
std::string buffer{std::istream_iterator<char>(stream),
std::istream_iterator<char>()};
std::string buffer{std::istreambuf_iterator<char>(stream),
std::istreambuf_iterator<char>()};
if (stream.bad()) throw google::cloud::Status(stream.status());

std::cout << "The object has " << buffer.size() << " characters\n";
Expand All @@ -340,7 +340,7 @@ void ReadObjectGzip(google::cloud::storage::Client client,
std::string const& object_name) {
auto is =
client.ReadObject(bucket_name, object_name, gcs::AcceptEncodingGzip());
auto const contents = std::string{std::istream_iterator<char>(is), {}};
auto const contents = std::string{std::istreambuf_iterator<char>(is), {}};
if (is.bad()) throw google::cloud::Status(is.status());
std::cout << "The object has " << contents.size() << " characters\n";
}
Expand Down
Loading