Ejemplo n.º 1
0
        public void Read(ErpBinaryReader reader)
        {
            this.Name = reader.ReadString(4);

            this.Offset = reader.ReadUInt64();
            this.Size   = reader.ReadUInt64();
            this.Flags  = reader.ReadInt32();

            if (this.ParentFile.Version > 2)
            {
                this.Compression = (ErpCompressionAlgorithm)reader.ReadByte();
                this.PackedSize  = reader.ReadUInt64();
            }
            else
            {
                this.PackedSize = this.Size;
            }

            int pos = (int)reader.BaseStream.Position;

            reader.Seek((int)(this.ParentFile.ResourceOffset + this.Offset), SeekOrigin.Begin);
            this._data = reader.ReadBytes((int)this.PackedSize);
            reader.Seek(pos, SeekOrigin.Begin);
        }
Ejemplo n.º 2
0
        public void Read(ErpBinaryReader reader)
        {
            Name = reader.ReadString(4);

            Offset = reader.ReadUInt64();
            Size   = reader.ReadUInt64();
            Flags  = reader.ReadInt32();

            if (ParentFile.Version > 2)
            {
                Compression = (ErpCompressionAlgorithm)reader.ReadByte();
                PackedSize  = reader.ReadUInt64();
            }
            else
            {
                PackedSize = Size;
            }

            var pos = Convert.ToInt32(reader.BaseStream.Position);

            reader.Seek(Convert.ToInt32(ParentFile.ResourceOffset + Offset), SeekOrigin.Begin);
            _data = reader.ReadBytes(Convert.ToInt32(PackedSize));
            reader.Seek(pos, SeekOrigin.Begin);
        }