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

相关阅读 >>

Delphi2010中tresourcestream流使用

Delphi 突破主动防御

Delphi显示gif动画简单方法

Delphi system 中的数学函数

Delphi获取操作系统已运行的所有窗口程序

Delphi fmx 绘制非常精确的 时分秒针

Delphi整理五(枚举、子界、集合)

Delphi createprocesswithlogonw用法

Delphi 通过读取注册表信息获取桌面路径

Delphi tfilestream流操作1

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...