コード例 #1
0
        public void TestWrite()
        {
            var bytes    = new byte[9 * 1024];
            int position = 0;

            random.NextBytes(bytes);

            blocks.Position = 0;
            master.Position = 0;

            while (position < bytes.Length)
            {
                int n = Math.Min(bytes.Length - position, random.Next() % 4096);
                blocks.Write(bytes, position, n);
                master.Write(bytes, position, n);
                position += n;
            }

            blocks.Flush();
            master.Flush();
        }