ReadData() публичный Метод

Reads the data from a binary file
public ReadData ( BufferedBinaryReader binaryReader ) : void
binaryReader SwfDotNet.IO.Utils.BufferedBinaryReader Binary reader.
Результат void
Пример #1
0
        /// <summary>
        /// Read swf (header and tags), this is the only
        /// public method of <see cref="SwfDotNet.IO.SwfReader">SwfReader</see>
        /// with <see cref="SwfDotNet.IO.SwfReader.Close">Close</see> and
        /// <see cref="SwfDotNet.IO.SwfReader.ReadSwfHeader">ReadSwfHeader</see> methods.
        /// The returned <see cref="SwfDotNet.IO.Swf">Swf</see> object contains swf headers informations and the
        /// tags list.
        /// </summary>
        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));
        }
Пример #2
0
        /// <summary>
        /// Reads the SWF header only.
        /// This method don't read the complete content of the
        /// SWF file. Then, it provides the possibility to
        /// get faster header informations, and only it.
        /// </summary>
        /// <returns></returns>
        public SwfHeader ReadSwfHeader()
        {
            // compressed swf?
            if (br.PeekChar() == 'C')
            {
                Inflate();
            }

            SwfHeader header = new SwfHeader();

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

            tagList = new BaseTagCollection();
            br.Close();
            return(header);
        }
Пример #3
0
        /// <summary>
        /// Reads the SWF header only.
        /// This method don't read the complete content of the 
        /// SWF file. Then, it provides the possibility to
        /// get faster header informations, and only it.
        /// </summary>
        /// <returns></returns>
        public SwfHeader ReadSwfHeader()
        {
            // compressed swf?
            if (br.PeekChar()=='C')
                Inflate();

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

            tagList = new BaseTagCollection();
            br.Close();
            return header;
        }
Пример #4
0
        /// <summary>
        /// Read swf (header and tags), this is the only 
        /// public method of <see cref="SwfDotNet.IO.SwfReader">SwfReader</see>
        /// with <see cref="SwfDotNet.IO.SwfReader.Close">Close</see> and
        /// <see cref="SwfDotNet.IO.SwfReader.ReadSwfHeader">ReadSwfHeader</see> methods.
        /// The returned <see cref="SwfDotNet.IO.Swf">Swf</see> object contains swf headers informations and the
        /// tags list.
        /// </summary>
        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);
        }