Implemented serialization of arrays of primitive types.