Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions miniz_oxide/src/deflate/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ pub enum TDEFLFlush {
/// Compress as much as there is space for, and then return waiting for more input.
None = 0,

/// Try to flush all the current data and output an empty fixed block.
Partial = 1,

/// Try to flush all the current data and output an empty raw block.
Sync = 2,

Expand All @@ -240,6 +243,7 @@ impl From<MZFlush> for TDEFLFlush {
fn from(flush: MZFlush) -> Self {
match flush {
MZFlush::None => TDEFLFlush::None,
MZFlush::Partial => TDEFLFlush::Partial,
MZFlush::Sync => TDEFLFlush::Sync,
MZFlush::Full => TDEFLFlush::Full,
MZFlush::Finish => TDEFLFlush::Finish,
Expand All @@ -252,6 +256,7 @@ impl TDEFLFlush {
pub const fn new(flush: i32) -> Result<Self, MZError> {
match flush {
0 => Ok(TDEFLFlush::None),
1 => Ok(TDEFLFlush::Partial),
2 => Ok(TDEFLFlush::Sync),
3 => Ok(TDEFLFlush::Full),
4 => Ok(TDEFLFlush::Finish),
Expand Down Expand Up @@ -1692,6 +1697,8 @@ pub(crate) fn flush_block(
adler <<= 8;
}
}
} else if flush == TDEFLFlush::Partial {
output.put_bits(2, 10);
} else {
// Sync or Full flush.
// Output an empty raw block.
Expand Down
Loading