Create the short array at half the size of the byte array, and copy the byte data in:
short[] sdata = new short[(int)Math.Ceiling(data.Length / 2)]; Buffer.BlockCopy(data, 0, sdata, 0, data.Length);
It is the fastest method by far.
https://stackoverflow.com/questions/1104599/convert-byte-array-to-short-array-in-c-sharp
您可能感兴趣的文章:
- RabbitMQ单机集群搭建出现Error: unable to perform an operation on node 'rabbit1@ClusterNode1'
- DotNetty在window和linux下的性能对比
- .net core 图片合并,图片水印,等比例缩小,SixLabors.ImageSharp
- WPF简单的分页控件实现
- ASP.NET中实现中文简/繁体自动转换的类
- 前后端分离,https站点无法通过Ajax访问http资源(Mixed Content,The page at 'https://xxx.com' was loaded over HTTPS)
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论