Override ReadCord() to be implemented explicitly

PiperOrigin-RevId: 492461499
pull/11130/head
Martijn Vels 2 years ago committed by Copybara-Service
parent 1b1e399e2e
commit 599c1a46ab
  1. 12
      src/google/protobuf/io/zero_copy_stream_impl_lite.cc
  2. 1
      src/google/protobuf/io/zero_copy_stream_impl_lite.h

@ -467,6 +467,18 @@ int64_t LimitingInputStream::ByteCount() const {
}
}
bool LimitingInputStream::ReadCord(absl::Cord* cord, int count) {
if (count <= 0) return true;
if (count <= limit_) {
if (!input_->ReadCord(cord, count)) return false;
limit_ -= count;
return true;
}
input_->ReadCord(cord, limit_);
limit_ = 0;
return false;
}
// ===================================================================

@ -375,6 +375,7 @@ class PROTOBUF_EXPORT LimitingInputStream PROTOBUF_FUTURE_FINAL
void BackUp(int count) override;
bool Skip(int count) override;
int64_t ByteCount() const override;
bool ReadCord(absl::Cord* cord, int count) override;
private:

Loading…
Cancel
Save