Skip to content
Permalink
Browse files
Buffer.toString returned a unexpected result when the buffer offset w…
…as not zero

git-svn-id: https://svn.apache.org/repos/asf/activemq/activemq-protobuf/trunk@947431 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
chirino committed May 23, 2010
1 parent 5a3028e commit fcae9184991e42461bc0776ed90396e9b241e0b5
Showing 1 changed file with 3 additions and 0 deletions.
@@ -80,9 +80,12 @@ public Buffer compact() {
}

final public byte[] toByteArray() {
byte[] data = this.data;
int length = this.length;
if (length != data.length) {
byte t[] = new byte[length];
System.arraycopy(data, offset, t, 0, length);
data = t;
}
return data;
}

0 comments on commit fcae918

Please sign in to comment.