SwfDotNet.IO.SwfReader.ReadSwf C# (CSharp) Method

ReadSwf() public method

Read swf (header and tags), this is the only public method of SwfReader with Close and ReadSwfHeader methods. The returned Swf object contains swf headers informations and the tags list.
public ReadSwf ( ) : Swf
return Swf
        public Swf ReadSwf()
        {
            // compressed swf?
            if (br.PeekChar()=='C')
                Inflate();

            SwfHeader header = new SwfHeader();
            header.ReadData(br);
            this.version = header.Version;

            tagList = new BaseTagCollection();

            bool readEndTag = false; //necessary for the 1 more byte bug
            while (br.BaseStream.Position < br.BaseStream.Length && !readEndTag)
            {
                BaseTag b = SwfReader.ReadTag(this.version, this.br, this.tagList);
                if (b != null)
                {
                    if (b is EndTag)
                        readEndTag = true;
                    tagList.Add(b);
                }
            };

            br.Close();

            return new Swf(header, tagList);
        }

Usage Example

Example #1
0
 public SwfConverter(Stream stream)
 {
     SwfReader reader = new SwfReader(stream);
     swf = reader.ReadSwf();
     reader.Close();
     Convert();
 }
All Usage Examples Of SwfDotNet.IO.SwfReader::ReadSwf