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;