pub fn write_packet_length(
len_of_len: u8,
length: u32,
bytes: &mut [u8],
) -> Result<usize, Error>Expand description
Writes the variable-length packet length after the mandatory header.
Returns the number of bytes written (0, 1, 2, or 4).