diff options
author | Wouter van Oortmerssen <wvo@google.com> | 2015-01-16 15:35:48 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <wvo@google.com> | 2015-01-16 15:36:25 -0800 |
commit | e568f170963d4d5dff5069e5012a1816185d3d6d (patch) | |
tree | 9bd63408737e44e6ac2c3b0b76b02a4074cd50c7 /net | |
parent | 1263e9788e0a40ae1c0479c4478209d4991a35a7 (diff) | |
download | flatbuffers-e568f170963d4d5dff5069e5012a1816185d3d6d.tar.gz flatbuffers-e568f170963d4d5dff5069e5012a1816185d3d6d.tar.bz2 flatbuffers-e568f170963d4d5dff5069e5012a1816185d3d6d.zip |
Fixed C# SizedByteArray copying leading bytes of ByteBuffer.
Tested: on Windows.
Change-Id: I946dacf799eae835ec041ea759622f74b0384937
Diffstat (limited to 'net')
-rw-r--r-- | net/FlatBuffers/FlatBufferBuilder.cs | 4 | ||||
-rw-r--r-- | net/FlatBuffers/FlatBuffers.csproj | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/net/FlatBuffers/FlatBufferBuilder.cs b/net/FlatBuffers/FlatBufferBuilder.cs index 68225f93..a91b8f27 100644 --- a/net/FlatBuffers/FlatBufferBuilder.cs +++ b/net/FlatBuffers/FlatBufferBuilder.cs @@ -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; } diff --git a/net/FlatBuffers/FlatBuffers.csproj b/net/FlatBuffers/FlatBuffers.csproj index a973e698..9307c33f 100644 --- a/net/FlatBuffers/FlatBuffers.csproj +++ b/net/FlatBuffers/FlatBuffers.csproj @@ -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. |