Fix large message writing
This commit is contained in:
parent
16b0a338a7
commit
5f4f626206
@ -67,7 +67,7 @@ public class Message {
|
|||||||
while (this.length + remaining > capacity)
|
while (this.length + remaining > capacity)
|
||||||
if (!this.messageBuffer.expandMessage(this)) return -1;
|
if (!this.messageBuffer.expandMessage(this)) return -1;
|
||||||
|
|
||||||
int bytesToCopy = Math.min(remaining, capacity - length);
|
int bytesToCopy = Math.min(remaining, capacity - this.length);
|
||||||
System.arraycopy(byteArray, offset, sharedArray, this.offset + this.length, bytesToCopy);
|
System.arraycopy(byteArray, offset, sharedArray, this.offset + this.length, bytesToCopy);
|
||||||
this.length += bytesToCopy;
|
this.length += bytesToCopy;
|
||||||
return bytesToCopy;
|
return bytesToCopy;
|
||||||
|
Reference in New Issue
Block a user