Compare commits
1
Commits
3ef19612d7
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61a8758082 |
+15
-1
@@ -1,6 +1,20 @@
|
||||
mod crc32;
|
||||
mod header;
|
||||
|
||||
struct GzipFile {
|
||||
pub struct GzipFile {
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user