ByteBuf.ensureWritable

Expands the buffer {@link #capacity()} to make sure the number of {@linkplain #writableBytes() writable bytes} is equal to or greater than the specified value. If there are enough writable bytes in this buffer, this method returns with no side effect.

@param minWritableBytes the expected minimum number of writable bytes @throws IndexOutOfBoundsException if {@link #writerIndex()} + {@code minWritableBytes} > {@link #maxCapacity()}. @see #capacity(int)

  1. ByteBuf ensureWritable(int minWritableBytes)
    class ByteBuf
    abstract
    ensureWritable
  2. int ensureWritable(int minWritableBytes, bool force)

Meta