Skip to content

Commit

Permalink
Added (very) basic ZIP parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Le0X8 committed Jul 12, 2024
1 parent 77c18a6 commit 7438d4a
Show file tree
Hide file tree
Showing 11 changed files with 473 additions and 16 deletions.
283 changes: 283 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ path = 'src/lib.rs'
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
chrono = "0.4.38"
6 changes: 6 additions & 0 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ impl<'a> File<'a> {
String::from_utf8(buf).unwrap()
}

pub fn read_u8array(&mut self, len: u64) -> Vec<u8> {
let mut buf = vec![0; len as usize];
self.read(&mut buf);
buf
}

pub fn read_u8(&mut self) -> u8 {
let mut buf = [0; 1];
self.read(&mut buf);
Expand Down
Loading

0 comments on commit 7438d4a

Please sign in to comment.