fn write_length(length: usize, buf: &mut Vec<u8>)
Writes a BER/A-XDR length octet (short or long form).