mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 17:32:32 +00:00
946a126799
Buffer for reading from a compressed file with just checking checksums of the compressed blocks, without any decompression, so result can be proxied.
25 lines
693 B
C++
25 lines
693 B
C++
#include <Compression/CheckingCompressedReadBuffer.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
bool CheckingCompressedReadBuffer::nextImpl()
|
|
{
|
|
size_t size_decompressed;
|
|
size_t size_compressed_without_checksum;
|
|
size_t size_compressed = readCompressedData(size_decompressed, size_compressed_without_checksum, true);
|
|
|
|
if (!size_compressed)
|
|
return false;
|
|
|
|
/// own_compressed_buffer also includes getAdditionalSizeAtTheEndOfBuffer()
|
|
/// which should not be accounted here, so size_compressed is used.
|
|
///
|
|
/// And BufferBase is used over ReadBuffer, since former reset the working_buffer.
|
|
BufferBase::set(own_compressed_buffer.data(), size_compressed, 0);
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|