// Client
begin
IdTCPClient.WriteLn('ARR');
IdTCPClient.WriteCardinal(Length(Arr));
IdTCPClient.WriteBuffer(Arr, Length(Arr) * sizeof(Byte));
end;
// Server
var
...
Command : String;
Len: Cardinal;
begin
Command := AThread.Connection.ReadLn;
if Command = 'ARR' then
begin
Len := AThread.Connection.ReadCardinal;
if Len > 0 then
begin
SetLength(Arr, Len);
AThread.Connection.ReadBuffer(Arr, sizeof(Byte) * Len);
end;
end;
end;