Beispiel #1
0
        public void WriteByteAfterBitsTest()
        {
            var mem    = new MemoryStream();
            var writer = new SwfStreamWriter(mem);

            writer.WriteBit(true);
            writer.WriteBit(false);
            writer.WriteBit(true);
            writer.WriteBit(false);
            writer.WriteBit(true);
            writer.WriteBit(false);

            writer.WriteByte(0xc3);

            mem.Seek(0, SeekOrigin.Begin);

            Assert.AreEqual(0xa8, mem.ReadByte(), "Byte 0");
            Assert.AreEqual(0xc3, mem.ReadByte(), "Byte 1");

            Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream");
        }
Beispiel #2
0
        public void WriteByteAfterBitsTest()
        {
            var mem = new MemoryStream();
            var writer = new SwfStreamWriter(mem);

            writer.WriteBit(true);
            writer.WriteBit(false);
            writer.WriteBit(true);
            writer.WriteBit(false);
            writer.WriteBit(true);
            writer.WriteBit(false);

            writer.WriteByte(0xc3);

            mem.Seek(0, SeekOrigin.Begin);

            Assert.AreEqual(0xa8, mem.ReadByte(), "Byte 0");
            Assert.AreEqual(0xc3, mem.ReadByte(), "Byte 1");

            Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream");
        }