unsafe fn read_compressed_block(
reader: &mut BufReader<File>,
block: &ModuleBlockEntry,
data: &mut [u8],
) -> Result<()>
Expand description
Reads and decompresses a compressed block of data.
This function reads a compressed block from the file, decompresses it, and then copies the decompressed data into the appropriate section of the output buffer.
§Arguments
reader
- A mutable reference to aBufReader<File>
from which to read the data.block
- A reference to theModuleBlockEntry
containing metadata about the block.data
- A mutable slice where the decompressed data will be stored.
§Errors
- If the reader fails to read the exact number of bytes
ReadError
- If the decompression operation fails
Error::DecompressionError
§Safety
- This function is unsafe because it calls the
decompress
function, which is unsafe.