ByteBuf.capacity

Adjusts the capacity of this buffer. If the {@code newCapacity} is less than the current capacity, the content of this buffer is truncated. If the {@code newCapacity} is greater than the current capacity, the buffer is appended with unspecified data whose length is {@code (newCapacity - currentCapacity)}.

@throws IllegalArgumentException if the {@code newCapacity} is greater than {@link #maxCapacity()}

  1. int capacity()
  2. ByteBuf capacity(int newCapacity)
    class ByteBuf
    abstract
    capacity

Meta