public void FastBufferCopy() { for (int i = 0; i < N; i++) { FastBuffer.BlockCopy(bufferFrom, 0, bufferTo, 0, Size); } }
public void TestCopy() { for (int i = 0; i < 1024; i++) { var src = new byte[i]; var dst = new byte[i]; var rd = new Random(Guid.NewGuid().GetHashCode()); rd.NextBytes(src); FastBuffer.BlockCopy(src, 0, dst, 0, src.Length); for (int n = 0; n < i; n++) { Assert.AreEqual(src[n], dst[n]); } } }
public static void TestCopy() { for (int i = 0; i < 1024; i++) { byte[] src = new byte[i]; for (int n = 0; n < i; n++) { src[n] = (byte)n; } byte[] dst = new byte[i]; FastBuffer.BlockCopy(src, 0, dst, 0, src.Length); for (int n = 0; n < i; n++) { if (src[n] != dst[n]) { Console.WriteLine("error:" + i); } } } Console.WriteLine("finish"); }