pub fn write<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
        let mut len = self.pairs.len() as u32;
        let mut bytes = [0; 4];
        for byte in bytes.iter_mut().rev() {
            *byte = len as u8;
            len >>= 8;
        }
        writer.write_all(&bytes)?;
        for &(count, byte) in &self.pairs {
            writer.write_all(&[byte, count])?;
        }
        Ok(())
    }
/// This function writes the frequencies as a sequence of
/// (byte, frequency) pairs, preceded by the number of pairs
/// it can read.
This function writes the frequencies as a sequence of
(byte, frequency) pairs, preceded by the number of pairs
it can read.
This function writes the frequencies as a sequence of ( byte frequency ) pairs preceded by the number of pairs it can read .
pub fn write<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
        let mut len = self.pairs.len() as u32;
        let mut bytes = [0; 4];
        for byte in bytes.iter_mut().rev() {
            *byte = len as u8;
            len >>= 8;
        }
        writer.write_all(&bytes)?;
        for &(count, byte) in &self.pairs {
            writer.write_all(&[byte, count])?;
        }
        Ok(())
    }
pub fn write < W : io :: Write > ( & self , writer : & mut W ) -> io :: Result < ( ) > { let mut len = self . pairs . len ( ) as u32 ; let mut bytes = [ 0 ; 4 ] ; for byte in bytes . iter_mut ( ) . rev ( ) { * byte = len as u8 ; len >>= 8 ; } writer . write_all ( & bytes ) ? ; for & ( count , byte ) in & self . pairs { writer . write_all ( & [ byte , count ] ) ? ; } Ok ( ( ) ) }
This function writes the frequencies as a sequence of
(byte, frequency) pairs, preceded by the number of pairs
it can read.
This function writes the frequencies as a sequence of ( byte frequency ) pairs preceded by the number of pairs it can read .
&self
writer
&mut W
&self
writer
&mut W