docs: @Override
    public final IoBuffer getSlice(int index, int length) {
      if (length < 0) {
        throw new IllegalArgumentException("length: " + length);
      }
  
      int limit = limit();
  
      if (index > limit) {
        throw new IllegalArgumentException("index: " + index);
      }
  
      int endIndex = index + length;
  
      if (capacity() < endIndex) {
        throw new IndexOutOfBoundsException(
            "index + length (" + endIndex + ") is greater " + "than capacity (" + capacity() + ").");
      }
  
      clear();
      position(index);
      limit(endIndex);
  
      IoBuffer slice = slice();
      position(index);
      limit(limit);
      return slice;
    }