public String getText(Interval interval) {if (interval.a < 0 || interval.b < interval.a - 1) {throw new IllegalArgumentException("invalid interval");}int bufferStartIndex = getBufferStartIndex();if (n > 0 && data[n - 1] == Character.MAX_VALUE) {if (interval.a + interval.length() > bufferStartIndex + n) {throw new IllegalArgumentException("the interval extends past the end of the stream");}}if (interval.a < bufferStartIndex || interval.b >= bufferStartIndex + n) {throw new UnsupportedOperationException("interval "+interval+" outside buffer: "+bufferStartIndex+".."+(bufferStartIndex+n-1));}int i = interval.a - bufferStartIndex;return new String(data, i, interval.length());}

public virtual string GetText(Interval interval){if (interval.a < 0 || interval.b < interval.a - 1){throw new ArgumentException("invalid interval");}int bufferStartIndex = BufferStartIndex;if (n > 0 && data[n - 1] == IntStreamConstants.EOF){if (interval.a + interval.Length > bufferStartIndex + n){throw new ArgumentException("the interval extends past the end of the stream");}}if (interval.a < bufferStartIndex || interval.b >= bufferStartIndex + n){throw new NotSupportedException("interval " + interval + " outside buffer: " + bufferStartIndex + ".." + (bufferStartIndex + n - 1));}int i = interval.a - bufferStartIndex;var sb = new StringBuilder(interval.Length);for (int offset = 0; offset < interval.Length; offset++) {sb.Append(Char.ConvertFromUtf32(data[i + offset]));}return sb.ToString();}
