pub fn load_from_binary_file(&mut self, path: &Path) -> Result<()> {
        //let mut file = try!(File::open(&path));
        let mut file = File::open(&path)?;
        let mut i = 0;
        let mut buffer: Vec<u8> = Vec::new();
        try!(file.read_to_end(&mut buffer));
        let mut j = 0;
        let mut sig = 0u16;
        for v in buffer {
            if j % 2 == 0 {
                sig = v as u16;
            } else {
                self.mem[i] = (sig << 8) + (v as u16);
                i += 1;
            }

            j += 1;
        }
        Ok(())
    }
/// Loads a binary file into the memory. The file needs to be assembled separately.
Loads a binary file into the memory. The file needs to be assembled separately.
Loads a binary file into the memory . The file needs to be assembled separately .
pub fn load_from_binary_file(&mut self, path: &Path) -> Result<()> {
        //let mut file = try!(File::open(&path));
        let mut file = File::open(&path)?;
        let mut i = 0;
        let mut buffer: Vec<u8> = Vec::new();
        try!(file.read_to_end(&mut buffer));
        let mut j = 0;
        let mut sig = 0u16;
        for v in buffer {
            if j % 2 == 0 {
                sig = v as u16;
            } else {
                self.mem[i] = (sig << 8) + (v as u16);
                i += 1;
            }
            j += 1;
        }
        Ok(())
    }
pub fn load_from_binary_file ( & mut self , path : & Path ) -> Result < ( ) > { //let mut file = try!(File::open(&path)); let mut file = File :: open ( & path ) ? ; let mut i = 0 ; let mut buffer : Vec < u8 > = Vec :: new ( ) ; try ! ( file read_to_end ( mut buffer ) ) ; let mut j = 0 ; let mut sig = 0u16 ; for v in buffer { if j % 2 == 0 { sig = v as u16 ; } else { self . mem [ i ] = ( sig << 8 ) + ( v as u16 ) ; i += 1 ; } j += 1 ; } Ok ( ( ) ) }
Loads a binary file into the memory.
Loads a binary file into the memory .
&mut self
path
&Path
&mut self
path
&Path