unsafe private void AppendHelper( char* pSource, int count ) {
if ( lastBuffer == null ) {
CreateBuffers();
}
int copyCount = 0;
while ( count > 0 ) {
if ( lastBufferIndex >= lastBuffer.Length ) {
AddBuffer();
}
copyCount = count;
int free = lastBuffer.Length - lastBufferIndex;
if ( free < copyCount ) {
copyCount = free;
}
fixed ( char* pLastBuffer = &lastBuffer[lastBufferIndex] ) {
wstrcpy( pLastBuffer, pSource, copyCount );
}
pSource += copyCount;
length += copyCount;
lastBufferIndex += copyCount;
count -= copyCount;
}
}