Skip to content

Commit 30e2a2b

Browse files
committed
feat(zstd): support reading uncompressed size
1 parent 4694d59 commit 30e2a2b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/compression-codecs/src/zstd/decoder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ impl Decode for ZstdDecoder {
7373
Ok(bytes_left == 0)
7474
}
7575

76+
fn uncompressed_size(&mut self, input: &mut PartialBuffer<impl AsRef<[u8]>>) -> Option<usize> {
77+
zstd_safe::find_frame_compressed_size(input.unwritten()).ok()
78+
}
79+
7680
fn finish(
7781
&mut self,
7882
output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,

0 commit comments

Comments
 (0)