utf8OffsetForUtf16Offset method

int utf8OffsetForUtf16Offset(
  1. int offset
)

Converts a UTF-16 offset, clamping out-of-range values to source bounds.

Implementation

int utf8OffsetForUtf16Offset(int offset) {
  RangeError.checkValueInInterval(offset, 0, utf16Length, 'offset');
  return _utf8Offsets[_boundaryAtOrBefore(_utf16Offsets, offset)];
}