Work around netty offheap capacity check bug

patch by tjake; reviewed by Mikhail Stepura for CASSANDRA-7196
This commit is contained in:
Jake Luciani 2014-05-09 16:39:48 -04:00
parent 65a46265df
commit e3dd88a8cd
1 changed files with 5 additions and 2 deletions

View File

@ -330,8 +330,11 @@ public abstract class CBUtil
return;
}
cb.writeInt(bytes.remaining());
cb.writeBytes(bytes.duplicate());
int remaining = bytes.remaining();
cb.writeInt(remaining);
if (remaining > 0)
cb.writeBytes(bytes.duplicate());
}
public static int sizeOfValue(byte[] bytes)