diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index d052ad5..c40cb60 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -6,6 +6,8 @@ pub fn compress_block(data: &[u8], output: &mut Vec) { let mut writer = BitWriter::from(output); compress_literals(data, &mut writer); //raw_literals(data, &mut writer); + //sequences + writer.write_bits(0u8, 8); writer.flush(); } @@ -16,9 +18,6 @@ fn raw_literals(literals: &[u8], writer: &mut BitWriter<&mut Vec>) { writer.write_bits(0b11u8, 2); writer.write_bits(literals.len() as u32, 20); writer.append_bytes(literals); - - //sequences - writer.write_bits(0u8, 8); } fn compress_literals(literals: &[u8], writer: &mut BitWriter<&mut Vec>) { @@ -47,7 +46,4 @@ fn compress_literals(literals: &[u8], writer: &mut BitWriter<&mut Vec>) { }; let encoded_len = (writer.index() - index_before) / 8; writer.change_bits(size_index, encoded_len as u64, size_bits); - - //sequences - writer.write_bits(0u8, 8); }