void (int newCount) { int newLength = newCount > myBuffer.length ? Math.max(myBuffer.length << 1, newCount) : myBuffer.length; byte[] newBuffer = myAllocator.allocate(newLength); System.arraycopy(myBuffer, 0, newBuffer, 0, myBuffer.length); myBuffer = newBuffer; }