procedure TLineStreamer.InternalBufferData; var NewBuffer: PChar; DataRead: integer; BufferData : array[0..BlockSize] of Char; begin // Step 1. Read the data from the stream // Read The Data DataRead := DataStream.Read(BufferData, SizeOf(BufferData)); // Allocate the new buffer GetMem(NewBuffer, BlockSize + 1); // Copy the New Data Into The Buffer StrPLCopy(NewBuffer, BufferData, DataRead); // Concat the buffers Buffer := Buffer + NewBuffer; // Return the buffer memory FreeMem(NewBuffer); // Step 2. Chop the data into a stringlist BufferList.Clear; Buffer := GetUsableLines(Buffer, BufferList); // Step 3. Update the numbers Inc(MaxLine, BufferList.Count); CurrentBufferLine := 0; end;