Permalink
Browse files

Message.setObject() now checks for a byte[] buffer as arg; this saves…

… 1 copy of the byte[] buffer !
  • Loading branch information...
1 parent a34d226 commit 79c6060582cdbf5c6f630a81c9d7792f81d289a3 Bela Ban committed Dec 9, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/org/jgroups/Message.java
@@ -343,11 +343,14 @@ public int getNumHeaders() {
*/
final public void setObject(Object obj) {
if(obj == null) return;
+ if(obj instanceof byte[]) {
+ setBuffer((byte[])obj);
+ return;
+ }
if(obj instanceof Buffer) {
setBuffer((Buffer)obj);
return;
}
-
try {
byte[] tmp=Util.objectToByteBuffer(obj);
setBuffer(tmp);

0 comments on commit 79c6060

Please sign in to comment.