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)); }
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]); } }
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]); }
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)); }