Skip to content

Commit 08fb5a6

Browse files
committed
feat(zstd): support reading uncompressed size
1 parent 6b23116 commit 08fb5a6

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

0 commit comments

Comments
 (0)