use std::mem;
use std::io::Read;
use serde::Deserialize;

#[derive(Deserialize, Debug)]
#[repr(C)]
struct Header {
    name: [u8; 4],
    size: u32,
    reserved: u64,
}

const HEADER: &[u8]= &[1, 2, 3, 4, 239, 205, 171, 0, 239, 205, 171, 137, 103, 69, 35, 1];

pub fn run_main() {
    let header: Header = {
        let mut encoded = [0u8; mem::size_of::<Header>()];
    
        let mut reader = HEADER;
        reader.read_exact(&mut encoded).unwrap();
        bincode::deserialize(&encoded[..]).unwrap()
    };

    println!("{:?}", header);
}