mirror of
https://github.com/G2-Games/lbee-utils.git
synced 2025-04-19 07:12:55 -05:00
18 lines
479 B
Rust
18 lines
479 B
Rust
use byteorder::{ReadBytesExt, WriteBytesExt};
|
|
use std::io::{Read, Seek, Write};
|
|
|
|
use crate::common::CzError;
|
|
|
|
pub fn decode<T: Seek + ReadBytesExt + Read>(input: &mut T) -> Result<Vec<u8>, CzError> {
|
|
// Get the rest of the file, which is the bitmap
|
|
let mut bitmap = vec![];
|
|
input.read_to_end(&mut bitmap)?;
|
|
|
|
Ok(bitmap)
|
|
}
|
|
|
|
pub fn encode<T: WriteBytesExt + Write>(output: &mut T, bitmap: &[u8]) -> Result<(), CzError> {
|
|
output.write_all(bitmap)?;
|
|
|
|
Ok(())
|
|
}
|