csharp-buffer操作
Buffer.BlockCopy 真对原始数据实现的,速度较快
Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset.
Array.Copy 是真对通用环境实现的
Copies a range of elements in one Array to another Array and performs type casting and boxing as required.
Marshal.Copy
Copies data from a managed array to an unmanaged memory pointer, or from an unmanaged memory pointer to a managed array.
读写内存
MemoryStream和BufferedStream都派生自基类Stream,因此它们有很多共同的属性和方法,但是每一个类都有自己独特的用法。这两个类都是实现对内存进行数据读写的功能,而不是对持久性存储器进行读写。
MemoryStream类用于向内存而不是磁盘读写数据。MemoryStream封装以无符号字节数组形式存储的数据,该数组在创建MemoryStream对象时被初始化,或者该数组可创建为空数组。可在内存中直接访问这些封装的数据。内存流可降低应用程序中对临时缓冲区和临时文件的需要。