diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java index 1b2ab5d..7554201 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java @@ -86,7 +86,7 @@ public class ByteBufferOutputStream extends OutputStream { // size calculation is complex, because we could overflow negative, // and/or not allocate enough space. this fixes that. int newSize = (int)Math.min((((long)buf.capacity()) * 2), - (long)(Integer.MAX_VALUE)); + (long)(Integer.MAX_VALUE - 8/*See HBASE-14598*/)); newSize = Math.max(newSize, buf.position() + extra); ByteBuffer newBuf = allocate(newSize, buf.isDirect()); buf.flip();