Makes sure the number of {@linkplain #writableBytes() the writable bytes}is equal to or greater than the specified value. If there is enough writable bytes in this buffer, this method returns with no side effect. Otherwise:
- a non-dynamic buffer will throw an {@link IndexOutOfBoundsException}.
- a dynamic buffer will expand its capacity so that the number of the {@link #writableBytes() writable bytes} becomes equal to or greaterthan the specified value. The expansion involves the reallocation of the internal buffer and consequently memory copy.
@param writableBytes the expected minimum number of writable bytes
@throws IndexOutOfBoundsException if {@linkplain #writableBytes() the writable bytes} of thisbuffer is less than the specified value and if this buffer is not a dynamic buffer