Skip to main content

read_file_bytes

Function read_file_bytes 

Source
pub fn read_file_bytes(path: &Path) -> Result<Vec<u8>, Box<dyn Error>>
Expand description

File bytes in one read when the file is not compressed.

Gzip and zstd still go through the decoder. Plain text skips the four-byte probe and the UTF-8 String allocation.