summaryrefslogtreecommitdiff
path: root/dotnet/Qpid.Buffer/HeapByteBuffer.cs
diff options
context:
space:
mode:
authorSteven Shaw <steshaw@apache.org>2006-12-06 16:30:16 +0000
committerSteven Shaw <steshaw@apache.org>2006-12-06 16:30:16 +0000
commit355a889c72f14342c3cb6b50e28e9fad6149d888 (patch)
tree5477565cdeb14659c3e45fb9880b61c71a28f37c /dotnet/Qpid.Buffer/HeapByteBuffer.cs
parentcf3c35c56bf467619fe84d06d1bf322b95e65f80 (diff)
downloadqpid-python-355a889c72f14342c3cb6b50e28e9fad6149d888.tar.gz
QPID-128 Missed a couple of things while porting Java client changes recently.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@483135 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Buffer/HeapByteBuffer.cs')
-rw-r--r--dotnet/Qpid.Buffer/HeapByteBuffer.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/dotnet/Qpid.Buffer/HeapByteBuffer.cs b/dotnet/Qpid.Buffer/HeapByteBuffer.cs
index c54272b33f..ea3b11b60d 100644
--- a/dotnet/Qpid.Buffer/HeapByteBuffer.cs
+++ b/dotnet/Qpid.Buffer/HeapByteBuffer.cs
@@ -126,8 +126,11 @@ namespace Qpid.Buffer
}
public override byte[] ToByteArray()
- {
- return _underlyingData;
+ {
+ // Return copy of bytes remaining.
+ byte[] result = new byte[Remaining];
+ Array.Copy(_underlyingData, _position, result, 0, Remaining);
+ return result;
}
private void CheckSpace(int size)