public void TestReadByteEOS() { BigMemoryStream stream = new BigMemoryStream(100); stream.Position = 100; int b = stream.ReadByte(); Assert.AreEqual(-1, b); }
public void TestReadLastByteUnsetWithMaxSizeOfUnderlyingStream() { BigMemoryStream stream = new BigMemoryStream(BigMemoryStream.MEMORY_STREAM_MAX_SIZE); stream.Position = stream.Length - 1; int b = stream.ReadByte(); Assert.AreEqual(0, b); }
public void TestReadLastByteUnset() { BigMemoryStream stream = new BigMemoryStream(100); stream.Position = stream.Length - 1; int b = stream.ReadByte(); Assert.AreEqual(0, b); }
public void TestReadByteEOSBig() { long length = 3L * 1024L * 1024L * 1024L; //3GiB BigMemoryStream stream = new BigMemoryStream(length); stream.Position = length; int b = stream.ReadByte(); Assert.AreEqual(-1, b); }
public void TestReadWriteByte() { BigMemoryStream stream = new BigMemoryStream(100); stream.WriteByte(5); stream.Position = 0; Assert.AreEqual(5, stream.ReadByte()); }
public void TestPositionMovesOnReadByte() { BigMemoryStream stream = new BigMemoryStream(100); stream.Position = 5; stream.ReadByte(); Assert.AreEqual(6, stream.Position); }
public void TestReadLastByteUnsetBig() { long length = 3L * 1024L * 1024L * 1024L; //3GiB BigMemoryStream stream = new BigMemoryStream(length); stream.Position = stream.Length - 1; int b = stream.ReadByte(); Assert.AreEqual(0, b); }
public void TestReadWriteLastByteInStreamAtMaxOfUnderlyingStream() { BigMemoryStream stream = new BigMemoryStream(BigMemoryStream.MEMORY_STREAM_MAX_SIZE); stream.Position = BigMemoryStream.MEMORY_STREAM_MAX_SIZE - 1; stream.WriteByte(5); stream.Position = BigMemoryStream.MEMORY_STREAM_MAX_SIZE - 1; int b = stream.ReadByte(); Assert.AreEqual(5, b); }
public void TestReadWriteLastByte() { BigMemoryStream stream = new BigMemoryStream(100); stream.Position = 99; stream.WriteByte(5); stream.Position = 99; int b = stream.ReadByte(); Assert.AreEqual(5, b); }
public void TestReadWriteFirstByteInSecondUnderlyingStream() { long length = BigMemoryStream.MEMORY_STREAM_MAX_SIZE + 5; BigMemoryStream stream = new BigMemoryStream(length); stream.Position = BigMemoryStream.MEMORY_STREAM_MAX_SIZE; stream.WriteByte(5); stream.Position = BigMemoryStream.MEMORY_STREAM_MAX_SIZE; int b = stream.ReadByte(); Assert.AreEqual(5, b); }
public void TestReadWriteLastByteBig() { long length = 3L * 1024L * 1024L * 1024L; //3GiB BigMemoryStream stream = new BigMemoryStream(length); stream.Position = length - 1; stream.WriteByte(5); stream.Position = length - 1; int b = stream.ReadByte(); Assert.AreEqual(5, b); }