| 
 | 
 
<草稿>- uses
 
 -   IdGlobal;
 
 -  
 
 - var
 
 -   Bytes1, Bytes2, CombinedBytes: TIdBytes;
 
 -   i: Integer;
 
 - begin
 
 -   // 假设Bytes1和Bytes2是已经初始化并填充数据的TIdBytes对象
 
 -   // 这里只是为了示例,所以我们使用简单的赋值来模拟数据
 
 -   Bytes1 := Bytes2('Hello');
 
 -   Bytes2 := Bytes2('World');
 
 -  
 
 -   // 计算CombinedBytes需要的最终大小
 
 -   SetLength(CombinedBytes, Length(Bytes1) + Length(Bytes2));
 
 -  
 
 -   // 将Bytes1的内容复制到CombinedBytes
 
 -   for i := 0 to Length(Bytes1) - 1 do
 
 -   begin
 
 -     CombinedBytes[i] := Bytes1[i];
 
 -   end;
 
 -  
 
 -   // 将Bytes2的内容复制到CombinedBytes的末尾
 
 -   for i := 0 to Length(Bytes2) - 1 do
 
 -   begin
 
 -     CombinedBytes[Length(Bytes1) + i] := Bytes2[i];
 
 -   end;
 
 -  
 
 -   // CombinedBytes现在包含了Bytes1和Bytes2的内容
 
 - end;
 
  复制代码 |   
 
 
 
 |