public void EnhancedBlockStream_ToByteArray() { var es = new EnhancedBlockStream(); byte[] buf; es.Write(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, 0, 10); buf = es.ToArray(); CollectionAssert.AreEqual(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, buf); buf[0] = 255; es.Position = 0; Assert.AreEqual(0, es.ReadByte()); }