Fixed C# SizedByteArray copying leading bytes of ByteBuffer.

Tested: on Windows.

Change-Id: I946dacf799eae835ec041ea759622f74b0384937
This commit is contained in:
Wouter van Oortmerssen
2015-01-16 15:35:48 -08:00
parent 1263e9788e
commit e568f17096
3 changed files with 20 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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.