Exemplo n.º 1
0
 public override java.lang.CharSequence SubSequence(int start, int end)
 {
     checkStartEndRemaining(start, end);
     java.nio.CharSequenceAdapter result = copy(this);
     result._position = _position + start;
     result._limit    = _position + end;
     return(result);
 }
Exemplo n.º 2
0
 internal static java.nio.CharSequenceAdapter copy(java.nio.CharSequenceAdapter other
                                                   )
 {
     java.nio.CharSequenceAdapter buf = new java.nio.CharSequenceAdapter(other.sequence
                                                                         );
     buf._limit    = other._limit;
     buf._position = other._position;
     buf._mark     = other._mark;
     return(buf);
 }
Exemplo n.º 3
0
		internal static java.nio.CharSequenceAdapter copy(java.nio.CharSequenceAdapter other
			)
		{
			java.nio.CharSequenceAdapter buf = new java.nio.CharSequenceAdapter(other.sequence
				);
			buf._limit = other._limit;
			buf._position = other._position;
			buf._mark = other._mark;
			return buf;
		}
Exemplo n.º 4
0
 /// <summary>Creates a new char buffer by wrapping the given char sequence.</summary>
 /// <remarks>
 /// Creates a new char buffer by wrapping the given char sequence.
 /// <p>
 /// The new buffer's position will be
 /// <code>start</code>
 /// , limit will be
 /// <code>end</code>
 /// , capacity will be the length of the char sequence. The new
 /// buffer is read-only.
 /// </remarks>
 /// <param name="cs">the char sequence which the new buffer will be based on.</param>
 /// <param name="start">
 /// the start index, must not be negative and not greater than
 /// <code>cs.length()</code>
 /// .
 /// </param>
 /// <param name="end">
 /// the end index, must be no less than
 /// <code>start</code>
 /// and no
 /// greater than
 /// <code>cs.length()</code>
 /// .
 /// </param>
 /// <returns>the created char buffer.</returns>
 /// <exception>
 /// IndexOutOfBoundsException
 /// if either
 /// <code>start</code>
 /// or
 /// <code>end</code>
 /// is invalid.
 /// </exception>
 public static java.nio.CharBuffer wrap(java.lang.CharSequence cs, int start, int
                                        end)
 {
     if (start < 0 || end < start || end > cs.Length)
     {
         throw new System.IndexOutOfRangeException("cs.length()=" + cs.Length + ", start="
                                                   + start + ", end=" + end);
     }
     java.nio.CharBuffer result = new java.nio.CharSequenceAdapter(cs);
     result._position = start;
     result._limit    = end;
     return(result);
 }