Compare commits

..
1 Commits
Author SHA1 Message Date
leonhard 61a8758082 feat: add byte conversion to gzip file 2026-10-23 13:26:23 +02:00
+15 -1
View File
@@ -1,6 +1,20 @@
mod crc32; mod crc32;
mod header; mod header;
struct GzipFile { pub struct GzipFile {
header: header::Header, header: header::Header,
compressed_data: Vec<u8>,
crc32: u32,
input_size: u32,
}
impl From<GzipFile> for Vec<u8> {
fn from(mut gzip_file: GzipFile) -> Self {
let mut result = Vec::new();
result.append(&mut gzip_file.header.into());
result.append(&mut gzip_file.compressed_data);
result.extend(gzip_file.crc32.to_le_bytes());
result.extend(gzip_file.input_size.to_le_bytes());
result
}
} }