serialization of primitive arrays