viewBuffer method

  1. @override
ByteBuf viewBuffer(
  1. int index,
  2. int length
)
override

Returns a ByteBuf viewing a region beginning at index with the length of length.

The resulting buffer has both ByteBuf.readerIndex as well as ByteBuf.writerIndex set to 0 and all operations performed on the buffer do not affect the markers and indices of the root buffer.


Exceptions: Depending on the implementation.

Implementation

@override
ByteBuf viewBuffer(int index, int length) {
  return ByteDataBuffer(viewByteData(index, length));
}