You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
308 B

  1. package packet
  2. // Maximum length of the UTF-8 encoded strings
  3. const maxStringsLen = 65535
  4. // appendLenStr appends the length of the strings
  5. // and the strings to the byte slice.
  6. func appendLenStr(b []byte, s []byte) []byte {
  7. b = append(b, encodeUint16(uint16(len(s)))...)
  8. b = append(b, s...)
  9. return b
  10. }