List of utility methods to do ByteBuffer Grow
ByteBuffer | growBuffer(ByteBuffer b, int newCapacity) Grow a byte buffer, so it has a minimal capacity or at least the double capacity of the original buffer b.limit(b.position()); b.rewind(); int c2 = b.capacity() * 2; ByteBuffer on = ByteBuffer.allocate(c2 < newCapacity ? newCapacity : c2); on.put(b); return on; |
void | extendLimit(ByteBuffer buffer, int numBytes) extend Limit buffer.limit(buffer.limit() + numBytes); |