Example #1
0
        public void WriteAndReadIntViaMemoryFile()
        {
            var file = new Torch.IO.MemoryFile("rwb");

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

            Assert.AreEqual(13, rd);
            rd = file.ReadInt();
            Assert.AreEqual(17, rd);
            file.Close();
            Assert.IsFalse(file.IsOpen);
        }
Example #2
0
        public void WriteIntToMemoryFile()
        {
            var file = new Torch.IO.MemoryFile("wb");

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