diff options
author | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
commit | b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806 (patch) | |
tree | 2a23209faf0fea5586a6d4b9cee60d1b318d29fe /library/cpp/skiff/zerocopy_output_writer-inl.h | |
parent | 559174a9144de40d6bb3997ea4073c82289b4974 (diff) | |
download | ydb-b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806.tar.gz |
remove kikimr/driver DEPENDS
Diffstat (limited to 'library/cpp/skiff/zerocopy_output_writer-inl.h')
-rw-r--r-- | library/cpp/skiff/zerocopy_output_writer-inl.h | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/library/cpp/skiff/zerocopy_output_writer-inl.h b/library/cpp/skiff/zerocopy_output_writer-inl.h deleted file mode 100644 index 6bd067c9fa..0000000000 --- a/library/cpp/skiff/zerocopy_output_writer-inl.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once -#ifndef ZEROCOPY_OUTPUT_WRITER_INL_H_ -#error "Direct inclusion of this file is not allowed, include zerocopy_output_writer.h" -// For the sake of sane code completion. -#include "zerocopy_output_writer.h" -#endif - -#include <util/system/yassert.h> - -namespace NSkiff { - -//////////////////////////////////////////////////////////////////////////////// - -char* TZeroCopyOutputStreamWriter::Current() const -{ - return Current_; -} - -ui64 TZeroCopyOutputStreamWriter::RemainingBytes() const -{ - return RemainingBytes_; -} - -void TZeroCopyOutputStreamWriter::Advance(size_t bytes) -{ - Y_VERIFY(bytes <= RemainingBytes_); - Current_ += bytes; - RemainingBytes_ -= bytes; -} - -void TZeroCopyOutputStreamWriter::Write(const void* buffer, size_t length) -{ - if (length > RemainingBytes_) { - UndoRemaining(); - Output_->Write(buffer, length); - TotalWrittenBlockSize_ += length; - ObtainNextBlock(); - } else { - memcpy(Current_, buffer, length); - Advance(length); - } -} - -ui64 TZeroCopyOutputStreamWriter::GetTotalWrittenSize() const -{ - return TotalWrittenBlockSize_ - RemainingBytes_; -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NSkiff |