Read() public method

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int
        public void Test_ProgressStream()
        {
            int count = 0;

            try
            {
                using (MemoryStream memoryStream = new MemoryStream(new byte[4096 * 10]))
                using (ProgressStream progressStream = new ProgressStream(
                    memoryStream,
                    (object sender, long readSize, long writeSize, out bool isStop) =>
                    {
                        count++;

                        if (readSize >= 8192)
                        {
                            isStop = true;
                        }
                        else
                        {
                            isStop = false;
                        }
                    },
                    4096))
                {
                    byte[] tbyte = new byte[4096];

                    for (int i = 0; i < 4; i++)
                    {
                        progressStream.Read(tbyte, 0, tbyte.Length);
                    }
                }
            }
            catch (StopIoException)
            {
                Assert.AreEqual(count, 2, "ProgressStream");
            }
        }