diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/stream/length.cpp | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) | |
download | ydb-9123176b341b6f2658cff5132482b8237c1416c8.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/stream/length.cpp')
-rw-r--r-- | util/stream/length.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/util/stream/length.cpp b/util/stream/length.cpp index 09968fc2ab..9907fe2ac9 100644 --- a/util/stream/length.cpp +++ b/util/stream/length.cpp @@ -1,32 +1,32 @@ -#include "length.h" - -size_t TLengthLimitedInput::DoRead(void* buf, size_t len) { - const size_t toRead = (size_t)Min<ui64>(Length_, len); - const size_t ret = Slave_->Read(buf, toRead); - - Length_ -= ret; - - return ret; -} - -size_t TLengthLimitedInput::DoSkip(size_t len) { - len = (size_t)Min<ui64>((ui64)len, Length_); - len = Slave_->Skip(len); - Length_ -= len; - return len; -} - -size_t TCountingInput::DoRead(void* buf, size_t len) { - const size_t ret = Slave_->Read(buf, len); - Count_ += ret; - return ret; -} - -size_t TCountingInput::DoSkip(size_t len) { - const size_t ret = Slave_->Skip(len); - Count_ += ret; - return ret; -} +#include "length.h" + +size_t TLengthLimitedInput::DoRead(void* buf, size_t len) { + const size_t toRead = (size_t)Min<ui64>(Length_, len); + const size_t ret = Slave_->Read(buf, toRead); + + Length_ -= ret; + + return ret; +} + +size_t TLengthLimitedInput::DoSkip(size_t len) { + len = (size_t)Min<ui64>((ui64)len, Length_); + len = Slave_->Skip(len); + Length_ -= len; + return len; +} + +size_t TCountingInput::DoRead(void* buf, size_t len) { + const size_t ret = Slave_->Read(buf, len); + Count_ += ret; + return ret; +} + +size_t TCountingInput::DoSkip(size_t len) { + const size_t ret = Slave_->Skip(len); + Count_ += ret; + return ret; +} size_t TCountingInput::DoReadTo(TString& st, char ch) { const size_t ret = Slave_->ReadTo(st, ch); |