zoukankan
html css js c++ java
字节数组转换成结构
据说是可以将字节数组转换成结构。我还没有测试。等要用的时候再来看看吧。先记到这儿。
using
System.Runtime.InteropServices;
static
object
BytesToStruct(
byte
[] bytes, Type strcutType)
{
int
size
=
Marshal.SizeOf(strcutType);
IntPtr buffer
=
Marshal.AllocHGlobal(size);
try
{
Marshal.Copy(bytes,
0
, buffer, size);
return
Marshal.PtrToStructure(buffer, strcutType);
}
finally
{
Marshal.FreeHGlobal(buffer);
}
}
查看全文
相关阅读:
20160205
20151120
20151023
20151023
20140207
yum工具介绍
Linux程序包管理
Linux任务计划、周期性任务执行
10 压缩和解压缩工具和bash脚本编程
9 btrfs文件系统
原文地址:https://www.cnblogs.com/fuyun/p/103084.html
最新文章
20190925
20190925
20190925
20190905
20190903
20190722
20190603
20190526
20190521
20190429
热门文章
20190415
20180726
20171201
20170319
20170310
20170114
20160803
20160307
20160223
20160220
Copyright © 2011-2022 走看看