Lucene.Net.Analysis.Tokenattributes.CharTermAttribute.CopyBuffer C# (CSharp) Method

CopyBuffer() public method

public CopyBuffer ( char buffer, int offset, int length ) : void
buffer char
offset int
length int
return void
        public void CopyBuffer(char[] buffer, int offset, int length)
        {
            GrowTermBuffer(length);
            Array.Copy(buffer, offset, TermBuffer, 0, length);
            TermLength = length;
        }

Usage Example

Example #1
0
        public virtual void TestToString()
        {
            char[]            b = new char[] { 'a', 'l', 'o', 'h', 'a' };
            CharTermAttribute t = new CharTermAttribute();

            t.CopyBuffer(b, 0, 5);
            Assert.AreEqual("aloha", t.ToString());

            t.SetEmpty().Append("hi there");
            Assert.AreEqual("hi there", t.ToString());
        }
All Usage Examples Of Lucene.Net.Analysis.Tokenattributes.CharTermAttribute::CopyBuffer