- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi Byte、PByte、TBytes的转换
PByte转TBytes:
a:PByte;
b:TBytes;
b := TBytes(a);
PByte转Byte:其实就是指针操作
a:PByte;
b:Byte;
b := a^;
Byte转PByte:也是指针操作
a:Byte;
b:PByte;
b := @a;
procedure ByteToBytes(var FData: TBytes; const Bytes: PByte; const BytesLen: Integer);
begin
SetLength(FData, BytesLen);
Move(Bytes^, FData[0], BytesLen);
end;
————————————————
原文链接:https://blog.csdn.net/ozhy111/article/details/102799388