public void RandomValueInt32ArrayTests(int length) { var array = new Int32[length]; var r = new Random(); r.NextBytes(MemoryMarshal.AsBytes(array.AsSpan())); var encoded = MessagePackSerializer.Serialize(array, options); Assert.IsNotNull(encoded); var decoded = MessagePackSerializer.Deserialize <Int32[]>(encoded, options); Assert.IsNotNull(decoded); Assert.AreEqual(length, decoded.Length); for (var index = 0; index < array.Length; index++) { Assert.AreEqual(array[index], decoded[index]); } }
public IKzWriter Add(Int32 v) { v.AsSpan().CopyTo(Memory.Span.Slice(Length)); Length += 4; return(this); }