Write clut16

This commit is contained in:
2022-09-23 22:01:52 +02:00
parent 8a88eae02a
commit 90a00b892a
4 changed files with 27 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
use std::{boxed::Box, io::{Read, Write}, path::PathBuf};
pub mod bits;
pub mod raw;
pub type Output = Box<dyn Write>;
pub type Input = Box<dyn Read>;

View File

@@ -0,0 +1,7 @@
use super::{Error, Output};
pub fn write_generic<T>(output: &mut Output, value: T) -> Result<usize, Error> {
let raw = unsafe {std::slice::from_raw_parts(&value as *const _ as *const u8, std::mem::size_of_val(&value))};
Error::try_or_new(output.write(raw))
}