Skip to main content

read_package

Function read_package 

Source
pub fn read_package(bytes: &[u8]) -> OgeomResult<Vec<(String, Vec<u8>)>>
Expand description

Read every part of a package: the entry names and their bytes.

Stored and deflated entries are read, each checked against its checksum, from classic and ZIP64 archives alike; the central directory’s sizes are the ones trusted, since a streamed entry’s local header leaves them zero or saturated. Any other compression method, an encrypted entry, or an archive spanning several disks is refused by name rather than half-read.

§Errors

OgeomError::Construction if the bytes are not a ZIP archive, an entry is damaged, or it is one of the refusals above.