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

相关阅读 >>

Delphi webbrowser执行脚本

Delphi 判断网站文件是否存在

Delphi webbrowser获取iframe页面内容

Delphi 我的电脑连接到 internet 了吗?

Delphi 2009 泛型容器单元(generics.collections)[1]: tlist<t>

Delphi 进程保护

Delphi 如何在richedit控件里加入链接

Delphi access技巧集

Delphi 复制文件到全盘

Delphi中判断一个字符串是否为数字

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



打赏

取消

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

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

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

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

评论

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