Save() public method

Saves the file to the specified stream.
public Save ( Stream stream ) : void
stream Stream The stream to save to.
return void
Example #1
0
        public void TestSaveMethod()
        {
            MotionFile motionFile = new MotionFile();
            motionFile.Load(TEST_FILE);

            MemoryStream savedStream = new MemoryStream();
            motionFile.Save(savedStream);

            savedStream.Seek(0, SeekOrigin.Begin);

            MotionFile savedMotionFile = new MotionFile();
            savedMotionFile.Load(savedStream);

            savedStream.Close();

            Assert.AreEqual(motionFile.FramesPerSecond, savedMotionFile.FramesPerSecond, "Frames per second values do not match");
            Assert.AreEqual(motionFile.ChannelCount, savedMotionFile.ChannelCount, "Channel counts do not match");

            for (int i = 0; i < motionFile.ChannelCount; i++) {
                Assert.AreEqual(motionFile[i].Type, savedMotionFile[i].Type, "Channel types do not match");
                Assert.AreEqual(motionFile[i].Index, savedMotionFile[i].Index, "Channel index values do not match");
            }

            Assert.AreEqual(motionFile.FramesPerSecond, savedMotionFile.FramesPerSecond, "Frame counts do not match");
        }