mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 08:05:06 +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;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@
|
||||
<Compile Include="Struct.cs" />
|
||||
<Compile Include="Table.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="FlatBuffers.1.0.0.nuspec" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Reference in New Issue
Block a user