public void ResetPositionTest2() { MemoryStream bytesRead = new MemoryStream(); var buffer = new NetworkBuffer(BIG_BUFFER_DATA.Length, BIG_BUFFER_DATA); byte[] read = buffer.Read(BIG_BUFFER_DATA.Length); try { buffer.Read(1); Assert.Fail("An exception should have been thrown when reading a fully read buffer."); }catch (Exception) { } buffer.ResetPosition(); try { read = buffer.Read(1); Assert.AreEqual <byte>(BIG_BUFFER_DATA[0], read[0]); } catch (Exception) { Assert.Fail("Reset position should have allowed for the buffer to be readable again."); } finally { buffer.Dispose(); } }