MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / verifyGZIPHeader

Function verifyGZIPHeader

src/common/file_system/gzip_file_system.cpp:42–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42static void verifyGZIPHeader(const uint8_t gzip_hdr[], idx_t read_count) {
43 if (read_count != GZipFileSystem::GZIP_HEADER_MINSIZE) {
44 throw IOException("Input is not a GZIP stream.");
45 }
46 if (gzip_hdr[0] != 0x1F || gzip_hdr[1] != 0x8B) {
47 throw IOException("Input is not a GZIP stream.");
48 }
49 if (gzip_hdr[2] != GZipFileSystem::GZIP_COMPRESSION_DEFLATE) {
50 throw IOException("Unsupported GZIP compression method.");
51 }
52 if (gzip_hdr[3] & GZipFileSystem::GZIP_FLAG_UNSUPPORTED) {
53 throw IOException("Unsupported GZIP archive.");
54 }
55}
56
57void MiniZStreamWrapper::initialize(CompressedFileInfo& fileInfo) {
58 close();

Callers 2

initializeMethod · 0.85
readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected