pub fn pack_string<Out: Write>( val: &str, maxsz: Option<usize>, out: &mut Out, ) -> Result<usize>
Pack a string with size limit check.