<p>Am 12.07.2017 16:08 schrieb "Bo Berglund" <<a href="mailto:bo.berglund@gmail.com">bo.berglund@gmail.com</a>>:<br>
> To remove Count processed bytes from the beginning:<br>
><br>
> Buffer: AnsiString;<br>
><br>
> Delete(Buffer, 1, Count)<br>
> or worse:<br>
> Buffer := Copy(Buffer, Count+1, Length(Buffer));</p>
<p>FPC trunk supports Delete() and Insert() on dynamic arrays (TBytes is merely a dynamic array) and Copy() is supported for longer already. You merely need to adjust the indices to 0-based instead of 1-based.<br>
Delete() and Insert() are also supported by Delphi XE8 and newer I think.</p>
<p>> For adding new data (c: AnsiChar) to the end:<br>
><br>
> Buffer := Buffer + c;</p>
<p>The + operator is not yet implemented by default on FPC (neither is Concat()), but you can easily declare that yourself.</p>
<p>Regards,<br>
Sven</p>