public void AddPiece(char c, PdfChunk chunk)
{
if (totalTextLength >= pieceSize) {
char[] tempText = text;
PdfChunk[] tempDetailChunks = detailChunks;
pieceSize *= 2;
text = new char[pieceSize];
detailChunks = new PdfChunk[pieceSize];
Array.Copy(tempText, 0, text, 0, totalTextLength);
Array.Copy(tempDetailChunks, 0, detailChunks, 0, totalTextLength);
}
text[totalTextLength] = c;
detailChunks[totalTextLength++] = chunk;
}