mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 06:04:12 +00:00
Fixed C# SizedByteArray copying leading bytes of ByteBuffer.
Tested: on Windows. Change-Id: I946dacf799eae835ec041ea759622f74b0384937
This commit is contained in:
@@ -359,9 +359,9 @@ namespace FlatBuffers
|
||||
// Utility function for copying a byte array that starts at 0.
|
||||
public byte[] SizedByteArray()
|
||||
{
|
||||
var newArray = new byte[_bb.Data.Length];
|
||||
var newArray = new byte[_bb.Data.Length - _bb.position()];
|
||||
Buffer.BlockCopy(_bb.Data, _bb.position(), newArray, 0,
|
||||
_bb.Data.Length);
|
||||
_bb.Data.Length - _bb.position());
|
||||
return newArray;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user