public virtual void TestInCoreInputStream()
        {
            int cnt = 256;

            byte[] test            = new TestRng(Sharpen.Extensions.GetTestName()).NextBytes(cnt);
            TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4);
            b.Write(test);
            b.Close();
            InputStream @in = b.OpenInputStream();

            byte[] act = new byte[cnt];
            IOUtil.ReadFully(@in, act, 0, cnt);
            NUnit.Framework.Assert.IsTrue(Arrays.Equals(test, act));
        }
Пример #2
0
        public virtual void TestInCoreInputStream()
        {
            int cnt = 256;

            byte[] test            = new TestRng(Sharpen.Extensions.GetTestName()).NextBytes(cnt);
            TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4);
            b.Write(test);
            b.Close();
            InputStream @in = b.OpenInputStream();

            byte[] act = new byte[cnt];
            IOUtil.ReadFully(@in, act, 0, cnt);
            for (int i = 0; i < test.Length; i++)
            {
                Assert.AreEqual(test[i], act[i]);
            }
        }
Пример #3
0
		public virtual void TestInCoreInputStream()
		{
			int cnt = 256;
			byte[] test = new TestRng(Sharpen.Extensions.GetTestName()).NextBytes(cnt);
			TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4);
			b.Write(test);
			b.Close();
			InputStream @in = b.OpenInputStream();
			byte[] act = new byte[cnt];
			IOUtil.ReadFully(@in, act, 0, cnt);
			for (int i = 0; i < test.Length; i ++)
				Assert.AreEqual (test[i], act[i]);
		}
Пример #4
0
 public virtual void TestInCoreInputStream()
 {
     int cnt = 256;
     byte[] test = new TestRng(Sharpen.Extensions.GetTestName()).NextBytes(cnt);
     TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4);
     b.Write(test);
     b.Close();
     InputStream @in = b.OpenInputStream();
     byte[] act = new byte[cnt];
     IOUtil.ReadFully(@in, act, 0, cnt);
     NUnit.Framework.Assert.IsTrue(Arrays.Equals(test, act));
 }