Skip to main content

read_compressed

Function read_compressed 

Source
pub fn read_compressed<R: Read + Seek>(
    reader: &mut R,
    volume: &ApfsVolume,
    inode: &Inode,
    header: &[u8],
    block_size: usize,
) -> Result<Vec<u8>>
Expand description

Read a transparently-compressed file’s content: decode the decmpfs payload (inline in the header xattr, or in the com.apple.ResourceFork stream) rather than the raw extent bytes.

§Errors

ApfsError::Decmpfs on any malformed header, unknown/unsupported compression type, missing resource fork, codec failure, or output-length mismatch (the decode never returns a partial buffer as success); the structural errors of crate::xattr::resource_fork when fetching the fork.