Example #1
0
 /// <summary>Copies the contents of buffer, starting at offset and continuing
 /// for length characters, into the termBuffer array.
 /// </summary>
 /// <param name="buffer">the buffer to copy
 /// </param>
 /// <param name="offset">the index in the buffer of the first character to copy
 /// </param>
 /// <param name="length">the number of characters to copy
 /// </param>
 public void  SetTermBuffer(System.String buffer, int offset, int length)
 {
     System.Diagnostics.Debug.Assert(offset <= buffer.Length);
     System.Diagnostics.Debug.Assert(offset + length <= buffer.Length);
     GrowTermBuffer(length);
     TextSupport.GetCharsFromString(buffer, offset, offset + length, termBuffer, 0);
     termLength = length;
 }
Example #2
0
        /// <summary>Copies the contents of buffer into the termBuffer array.</summary>
        /// <param name="buffer">the buffer to copy
        /// </param>
        public void  SetTermBuffer(System.String buffer)
        {
            int length = buffer.Length;

            GrowTermBuffer(length);
            TextSupport.GetCharsFromString(buffer, 0, length, termBuffer, 0);
            termLength = length;
        }
Example #3
0
        public void  Set(Term term)
        {
            if (term == null)
            {
                Reset();
                return;
            }
            System.String termText = term.Text;
            int           termLen  = termText.Length;

            text.SetLength(termLen);
            TextSupport.GetCharsFromString(termText, 0, termLen, text.result, 0);
            dirty     = true;
            field     = term.Field;
            this.term = term;
        }
 public override int Read(System.Char[] c, int off, int len)
 {
     if (left > len)
     {
         TextSupport.GetCharsFromString(s, upto, upto + len, c, off);
         upto += len;
         left -= len;
         return(len);
     }
     else if (0 == left)
     {
         // don't keep a reference (s could have been very large)
         s = null;
         return(0);
     }
     else
     {
         TextSupport.GetCharsFromString(s, upto, upto + left, c, off);
         int r = left;
         left = 0;
         upto = s.Length;
         return(r);
     }
 }