summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorWouter van Oortmerssen <wvo@google.com>2015-01-16 15:35:48 -0800
committerWouter van Oortmerssen <wvo@google.com>2015-01-16 15:36:25 -0800
commite568f170963d4d5dff5069e5012a1816185d3d6d (patch)
tree9bd63408737e44e6ac2c3b0b76b02a4074cd50c7 /net
parent1263e9788e0a40ae1c0479c4478209d4991a35a7 (diff)
downloadflatbuffers-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.cs4
-rw-r--r--net/FlatBuffers/FlatBuffers.csproj3
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.