Per spec flatbuffers have either ZStd or None compression.
|
/// Compression algorithm used for metadata files. |
|
#[repr(u8)] |
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)] |
|
pub enum CompressionAlgorithmBin { |
|
None = 0u8, |
|
Zstd = 1u8, |
|
} |
|
|
but currently we only support writing and reading. zstd
|
async fn check_and_decompress( |
|
mut read: Pin<Box<dyn AsyncBufRead + Send>>, |
|
file_type: FileTypeBin, |
|
) -> RepositoryResult<(SpecVersionBin, Vec<u8>)> { |
|
let (spec_version, compression) = check_header(&mut read, file_type).await?; |
|
debug_assert_eq!(compression, CompressionAlgorithmBin::Zstd); |
|
let mut decoder = ZstdDecoder::new(read); |
|
let mut buffer = Vec::new(); |
|
decoder.read_to_end(&mut buffer).await.capture()?; |
|
buffer.shrink_to_fit(); |
|
Ok((spec_version, buffer)) |
at a minimum we need to support reading
Per spec flatbuffers have either ZStd or None compression.
icechunk/icechunk-format/src/lib.rs
Lines 492 to 499 in fcee571
but currently we only support writing and reading. zstd
icechunk/icechunk/src/asset_manager.rs
Lines 1195 to 1205 in fcee571
at a minimum we need to support reading