Parse() public method

Parses this object out of a stream
public Parse ( Stream input ) : void
input Stream The input stream.
return void
示例#1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="imageDataSize"></param>
        /// <param name="bitmapFormat"></param>
        public virtual void Parse(Stream input, UInt64 imageDataSize, byte bitmapFormat)
        {
            if (bitmapFormat.Equals(0x04))
            {
                Pix15 temp = null;

                for (UInt64 i = 0; i < imageDataSize; i++)
                {
                    temp = new Pix15(this._SwfVersion);
                    temp.Parse(input);
                    this._bitmapPixelData.Add(temp);
                }

            }
            else if (bitmapFormat.Equals(0x05))
            {
                for (UInt64 i = 0; i < imageDataSize; i++)
                {
                    Pix24 temp = new Pix24(this._SwfVersion);
                    temp.Parse(input);
                    this._bitmapPixelData.Add(temp);
                }
            }
            else
            {
                SwfFormatException e = new SwfFormatException("BITMAPDATA can not contain any other bitmap formats than 15-bit RGB images or 24-bit RGB images ");
               Log.Error(this, e.Message);
                throw e;
            }
        }