Open Risord opened 7 months ago
@Risord Yeah, this indeed does look like it does not honor the ArraySegment and a fix would be for us to create a new constructor that does not include the length or offset parameters in order to be 100% sure of the intended usage.
For now, the work around would be to add the offset in the constuctor:
var bytes = new byte[] { 0, 1, 2, 3 };
var segment = new System.ArraySegment<byte>(bytes, 1, 3);
var reader = new Unity.Netcode.FastBufferReader(segment, Unity.Collections.Allocator.Temp, offset: 1);
Description
Expected Outcome
Both prints output: 1,2,3
Environment