| 40 | }; |
| 41 | |
| 42 | static 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 | |
| 57 | void MiniZStreamWrapper::initialize(CompressedFileInfo& fileInfo) { |
| 58 | close(); |
no outgoing calls
no test coverage detected