spf 0.7.2

.spf (Simple Pixel Font) file parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub use std::io::{Read, Write};

pub fn write_to_file(path: &'static str, data: &[u8]) -> std::io::Result<()> {
    let mut file = std::fs::OpenOptions::new()
        .write(true)
        .create(true)
        .open(path)?;
    file.write_all(data)?;
    Ok(())
}

pub fn read_from_file(path: &'static str, buffer: &mut Vec<u8>) -> std::io::Result<()> {
    let mut file = std::fs::OpenOptions::new().read(true).open(path)?;
    file.read_to_end(buffer)?;
    Ok(())
}