length = len(data)
# - if encoded as a list instead, serialize as bytes instead of string
if type(data) in [list, tuple]:
  buff.write(struct.Struct('<I%sB'%length).pack(length, *data))
else:
  buff.write(struct.Struct('<I%ss'%length).pack(length, data))
