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()}
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()}