ByteBuf.readSlice

Returns a new slice of this buffer's sub-region starting at the current {@code readerIndex} and increases the {@code readerIndex} by the size of the new slice (= {@code length}). <p> Also be aware that this method will NOT call {@link #retain()} and so the reference count will NOT be increased.

@param length the size of the new slice

@return the newly created slice

@throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes}

class ByteBuf
abstract
readSlice
(
int length
)

Meta