示例#1
0
        public override void Decode()
        {
            MemoryStream memoryStream = new MemoryStream(this.Data);
            BinaryReader binaryReader = new BinaryReader(memoryStream);

            this.BlipTypeWin32 = binaryReader.ReadByte();
            this.BlipTypeMacOS = binaryReader.ReadByte();
            this.UID           = new Guid(binaryReader.ReadBytes(16));
            this.Tag           = binaryReader.ReadUInt16();
            this.BlipSize      = binaryReader.ReadUInt32();
            this.Ref           = binaryReader.ReadInt32();
            this.Offset        = binaryReader.ReadInt32();
            this.Usage         = binaryReader.ReadByte();
            this.NameLength    = binaryReader.ReadByte();
            this.Unused2       = binaryReader.ReadByte();
            this.Unused3       = binaryReader.ReadByte();
            if (this.NameLength > 0)
            {
                this.BlipName = Encoding.Unicode.GetString(binaryReader.ReadBytes((int)this.NameLength));
            }
            if (memoryStream.Position < memoryStream.Length)
            {
                this.BlipRecord = (EscherRecord.Read(memoryStream) as MsofbtBlip);
                if (this.BlipRecord == null)
                {
                    throw new Exception("Image Type Not supported.");
                }
                this.BlipRecord.Decode();
                this.ImageData = this.BlipRecord.ImageData;
            }
            if (memoryStream.Position < memoryStream.Length)
            {
                this.ExtraData = StreamHelper.ReadToEnd(memoryStream);
            }
        }
        public override void Decode()
        {
            MemoryStream memoryStream = new MemoryStream(this.Data);

            this.EscherRecords.Clear();
            while (memoryStream.Position < memoryStream.Length)
            {
                EscherRecord escherRecord = EscherRecord.Read(memoryStream);
                escherRecord.Decode();
                this.EscherRecords.Add(escherRecord);
            }
        }
示例#3
0
        public override void Decode()
        {
            MemoryStream stream = new MemoryStream(Data);

            EscherRecords.Clear();
            while (stream.Position < stream.Length)
            {
                EscherRecord record = EscherRecord.Read(stream);
                record.Decode();
                EscherRecords.Add(record);
            }
        }
示例#4
0
        public override void Decode()
        {
            MemoryStream stream = new MemoryStream(Data);
            BinaryReader reader = new BinaryReader(stream);

            BlipTypeWin32 = reader.ReadByte();
            BlipTypeMacOS = reader.ReadByte();
            UID           = new Guid(reader.ReadBytes(16));
            Tag           = reader.ReadUInt16();
            BlipSize      = reader.ReadUInt32();
            Ref           = reader.ReadInt32();
            Offset        = reader.ReadInt32();
            Usage         = reader.ReadByte();
            NameLength    = reader.ReadByte();
            Unused2       = reader.ReadByte();
            Unused3       = reader.ReadByte();

            if (NameLength > 0)
            {
                BlipName = Encoding.Unicode.GetString(reader.ReadBytes(NameLength));
            }

            if (stream.Position < stream.Length)
            {
                BlipRecord = EscherRecord.Read(stream) as MsofbtBlip;
                if (BlipRecord != null)
                {
                    BlipRecord.Decode();
                    this.ImageData = BlipRecord.ImageData;
                }
                else
                {
                    throw new Exception("Image Type Not supported.");
                }
            }

            if (stream.Position < stream.Length)
            {
                ExtraData = StreamHelper.ReadToEnd(stream);
            }
        }