public void expandIfNecessary() {
        if (!hasRemaining()) {
            getBuffer(Utils.RAFT_DATA_BUF_SIZE);
        }
    }
A byte buffer collector that will expand automatically.

@author dennis
jraft-core/src/main/java/com/alipay/sofa/jraft/util/ByteBufferCollector.java