Support payload offsets

Support sending a file or stream payload from a non-zero offset.
This allows the clients to resume a transfer. Upper layers should use
this feature only when both sides support it.

PiperOrigin-RevId: 385137570
This commit is contained in:
Janusz Sobczak
2021-07-16 06:52:45 -07:00
committed by Copybara-Service
parent a8fe61d846
commit ed511f962d
14 changed files with 293 additions and 15 deletions
+2
View File
@@ -50,6 +50,8 @@ class InputFile final {
// Returns total size of this file in bytes.
std::int64_t GetTotalSize() const { return impl_->GetTotalSize(); }
ExceptionOr<size_t> Skip(size_t offset) { return impl_->Skip(offset); }
// Disallows further reads from the file and frees system resources,
// associated with it.
Exception Close() { return impl_->Close(); }