pub fn write_varint(value: u32, buffer: &mut [u8]) -> usize