@Override
		public String getText(Interval interval) {
			int startIdx = Math.min(interval.a, size);
			int len = Math.min(interval.b - interval.a + 1, size - startIdx);

			// We know there are no surrogates in this
			// array, since otherwise we would be given a
			// 32-bit int[] array.
			//
			// So, it's safe to treat this as if it were
			// UTF-16.
			return new String(charArray, startIdx, len);
		}
Return the UTF-16 encoded string for the given interval
runtime/Java/src/org/antlr/v4/runtime/CodePointCharStream.java