public int capacity() {
        return this.buffer != null ? this.buffer.capacity() : 0;
    }
A byte buffer collector that will expand automatically.

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