C#byte数组合并
2010-03-25 16:34
357 查看
byte[] head = new byte[] { 0x7e }; byte[] type = new byte[] { 0x00 }; byte[] content = Encoding.Default.GetBytes("ABCDEGF"); byte[] last = new byte[] { 0x23 }; byte[] full=new byte[head.Length+type.Length+content.Length+last.Length]; //head.CopyTo(full,0); //type.CopyTo(full, head.Length); //content.CopyTo(full,head.Length+type.Length); //last.CopyTo(full, head.Length + type.Length + content.Length); Stream s = new MemoryStream(); s.Write(head, 0, 1); s.Write(type,0,1); s.Write(content,0,content.Length); s.Write(last, 0, 1); s.Position = 0; int r = s.Read(full, 0, full.Length); if (r>0) { Console.WriteLine(Encoding.Default.GetString(full)); Console.WriteLine(full.Length); Console.WriteLine(full[0].ToString()); Console.WriteLine(full[1].ToString()); Console.WriteLine(full[9].ToString()); Console.Read(); }
相关文章推荐
- C# byte 数组合并
- c# 合并byte数组
- C# byte 数组合并
- C# byte 数组合并(转载)
- C# 对象、文件与二进制串(byte数组)之间的转换
- C#byte数组与Image的相互转换实例代码
- c#合并两个数组方法
- C# 二进制替换第二弹 二进制替换深入研究---List 与byte[] 效率对比 byte[] 数组 替换
- C#中字节数组(byte[])和字符串相互转换
- c# 十六进制字串 转 Byte数组
- c# 合并两个有序数组
- C# 合并数组、排序、删除重复项最优方案
- C#中将DateTime类型转换成Byte数组
- C# byte数组常用扩展浅析
- c#调用c++写成的dll文件,返回char*,返回数组,用ref接收,byte[] (zz)
- java 合并两个byte数组
- C#对多个集合和数组的操作(合并,去重,判断)
- c#中如何将byte数组转换成string从而在textbox中显示出来?
- C# byte数组转换成List<String>
- C# double float int string 与 byte数组 相互转化