pub fn write_u64<W: Write>(sink: &mut W, magnitude: u64) -> IonResult<usize> {
        // leading_zeros() uses an intrinsic to calculate this quickly
        let empty_leading_bytes: u32 = magnitude.leading_zeros() >> 3; // Divide by 8 to get byte count
        let first_occupied_byte = empty_leading_bytes as usize;

        let magnitude_bytes: [u8; mem::size_of::<u64>()] = magnitude.to_be_bytes();
        let bytes_to_write: &[u8] = &magnitude_bytes[first_occupied_byte..];

        sink.write_all(bytes_to_write)?;
        Ok(bytes_to_write.len())
    }
/// Encodes the provided `magnitude` as a UInt and writes it to the provided `sink`.
Encodes the provided `magnitude` as a UInt and writes it to the provided `sink`.
Encodes the provided ` magnitude ` as a UInt and writes it to the provided ` sink ` .
pub fn write_u64<W: Write>(sink: &mut W, magnitude: u64) -> IonResult<usize> {
        // leading_zeros() uses an intrinsic to calculate this quickly
        let empty_leading_bytes: u32 = magnitude.leading_zeros() >> 3; // Divide by 8 to get byte count
        let first_occupied_byte = empty_leading_bytes as usize;
        let magnitude_bytes: [u8; mem::size_of::<u64>()] = magnitude.to_be_bytes();
        let bytes_to_write: &[u8] = &magnitude_bytes[first_occupied_byte..];
        sink.write_all(bytes_to_write)?;
        Ok(bytes_to_write.len())
    }
pub fn write_u64 < W : Write > ( sink : & mut W , magnitude : u64 ) -> IonResult < usize > { // leading_zeros() uses an intrinsic to calculate this quickly let empty_leading_bytes : u32 = magnitude . leading_zeros ( ) >> 3 ; // Divide by 8 to get byte count let first_occupied_byte = empty_leading_bytes as usize ; let magnitude_bytes : [ u8 ; mem :: size_of :: < u64 > ( ) ] = magnitude . to_be_bytes ( ) ; let bytes_to_write : & [ u8 ] = & magnitude_bytes [ first_occupied_byte .. ] ; sink . write_all ( bytes_to_write ) ? ; Ok ( bytes_to_write . len ( ) ) }
Encodes the provided `magnitude` as a UInt and writes it to the provided `sink`.
Encodes the provided ` magnitude ` as a UInt and writes it to the provided ` sink ` .
sink
&mut W
magnitude
u64
sink
&mut W
magnitude
u64