public void RunHeaderTest(byte[] source, SwfCompression expectedCompression, byte expectedVersion, int expectedLength) { // use a memory stream for testing using (MemoryStream stream = new MemoryStream(source)) { SwfHeader header = SwfHeader.FromStream(stream); Assert.AreEqual(expectedCompression, header.Compression); Assert.AreEqual(expectedVersion, header.Version); Assert.AreEqual(expectedLength, header.FileLength); } }
/// <summary> /// Initializes a new instance of the <see cref="T:swfreader.SwfHeader"/> class. /// </summary> /// <param name="compression">The compression of the SWF file</param> /// <param name="version">The version of the SWF file</param> /// <param name="fileLength">The length of the uncompressed file</param> public SwfHeader(SwfCompression compression, byte version, uint fileLength) { this.Compression = compression; this.Version = version; this.FileLength = fileLength; }