pub fn write_bat_entries(
        f: &mut File,
        bat_offset: u64,
        bat_entries: &[BatEntry],
    ) -> Result<()> {
        for i in 0..bat_entries.len() as u64 {
            f.seek(SeekFrom::Start(bat_offset + i * size_of::<u64>() as u64))
                .map_err(VhdxBatError::WriteBat)?;
            let bat_entry = match bat_entries.get(i as usize) {
                Some(entry) => entry.0,
                None => {
                    return Err(VhdxBatError::InvalidBatEntry);
                }
            };

            f.write_u64::<LittleEndian>(bat_entry)
                .map_err(VhdxBatError::WriteBat)?;
        }
        Ok(())
    }
// Routine for writing BAT entries to the disk
Routine for writing BAT entries to the disk
Routine for writing BAT entries to the disk
pub fn write_bat_entries(
        f: &mut File,
        bat_offset: u64,
        bat_entries: &[BatEntry],
    ) -> Result<()> {
        for i in 0..bat_entries.len() as u64 {
            f.seek(SeekFrom::Start(bat_offset + i * size_of::<u64>() as u64))
                .map_err(VhdxBatError::WriteBat)?;
            let bat_entry = match bat_entries.get(i as usize) {
                Some(entry) => entry.0,
                None => {
                    return Err(VhdxBatError::InvalidBatEntry);
                }
            };
            f.write_u64::<LittleEndian>(bat_entry)
                .map_err(VhdxBatError::WriteBat)?;
        }
        Ok(())
    }
pub fn write_bat_entries ( f : & mut File , bat_offset : u64 , bat_entries : & [ BatEntry ] , ) -> Result < ( ) > { for i in 0 .. bat_entries . len ( ) as u64 { f . seek ( SeekFrom :: Start ( bat_offset + i * size_of :: < u64 > ( ) as u64 ) ) . map_err ( VhdxBatError :: WriteBat ) ? ; let bat_entry = match bat_entries . get ( i as usize ) { Some ( entry ) => entry . 0 , None => { return Err ( VhdxBatError :: InvalidBatEntry ) ; } } ; f . write_u64 :: < LittleEndian > ( bat_entry ) . map_err ( VhdxBatError :: WriteBat ) ? ; } Ok ( ( ) ) }
Routine for writing BAT entries to the disk
Routine for writing BAT entries to the disk
f
&mut File
bat_offset
u64
bat_entries
&[BatEntry]
f
&mut File
bat_offset
u64
bat_entries
&[BatEntry]