Ejemplo n.º 1
0
        public void WriteAndReadByteViaMemoryFile()
        {
            var file = new Torch.IO.MemoryFile("rwb");

            Assert.IsNotNull(file);
            Assert.IsTrue(file.CanWrite);
            file.WriteByte(13);
            file.WriteByte(17);
            file.Seek(0);
            var rd = file.ReadByte();

            Assert.AreEqual(13, rd);
            rd = file.ReadByte();
            Assert.AreEqual(17, rd);
            file.Close();
            Assert.IsFalse(file.IsOpen);
        }
Ejemplo n.º 2
0
        public void WriteByteToMemoryFile()
        {
            var file = new Torch.IO.MemoryFile("wb");

            Assert.IsNotNull(file);
            Assert.IsTrue(file.CanWrite);
            file.WriteByte(17);
            file.Close();
            Assert.IsFalse(file.IsOpen);
        }