code: public CharBuffer subSequence(int start, int end) {
          int pos = position();
          int lim = limit();
          assert (pos <= lim);
          pos = (pos <= lim ? pos : lim);
          int len = lim - pos;
  
          if ((start < 0) || (end > len) || (start > end))
              throw new IndexOutOfBoundsException();
          return new ByteBufferAsCharBuffer(bb,
                  -1,
                  pos + start,
                  pos + end,
                  capacity(),
                  offset,
                  order);
      }
docs: --- Methods to support CharSequence ---