Revert "[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)" (#6488)

This reverts commit cbbbaa61b3.
This commit is contained in:
Derek Bailey
2021-02-23 11:30:07 -08:00
committed by GitHub
parent cbbbaa61b3
commit 8cccdfba53
7 changed files with 19 additions and 24 deletions

View File

@@ -112,7 +112,7 @@ namespace FlatBuffers
// Get the data of a vector whoses offset is stored at "offset" in this object as an
// ArraySegment&lt;byte&gt;. If the vector is not present in the ByteBuffer,
// then a null value will be returned.
public ArraySegment<byte>? __vector_as_arraysegment(int offset, int elementSize)
public ArraySegment<byte>? __vector_as_arraysegment(int offset)
{
var o = this.__offset(offset);
if (0 == o)
@@ -122,7 +122,7 @@ namespace FlatBuffers
var pos = this.__vector(o);
var len = this.__vector_len(o);
return bb.ToArraySegment(pos, len * elementSize);
return bb.ToArraySegment(pos, len);
}
#endif