Skip to content

FastBufferReader does not respect ArraySegment.Offset #2885

@Risord

Description

@Risord

Description

var bytes = new byte[] { 0, 1, 2, 3 };
var segment = new ArraySegment<byte>(bytes, 1, 3);
var reader = new Unity.Netcode.FastBufferReader(segment, Unity.Collections.Allocator.Temp);
Debug.Log(string.Join(',', segment.ToArray())); // => 1,2,3
Debug.Log(string.Join(',', reader.ToArray())); // => 0,1,2

Expected Outcome

Both prints output: 1,2,3

Environment

  • OS: Windows 11
  • Unity Version: 2022.3.24
  • Netcode Version: 1.8.1

Metadata

Metadata

Labels

priority:highThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions