#pragma once #include #include namespace DB { class ReadBuffer; class WithFileSize { public: /// Returns nullopt if couldn't find out file size; virtual std::optional tryGetFileSize() = 0; virtual ~WithFileSize() = default; size_t getFileSize(); }; bool isBufferWithFileSize(const ReadBuffer & in); size_t getFileSizeFromReadBuffer(ReadBuffer & in); std::optional tryGetFileSizeFromReadBuffer(ReadBuffer & in); size_t getDataOffsetMaybeCompressed(const ReadBuffer & in); }