public void Read(ErpBinaryReader reader) { reader.ReadBytes(4); // entry info length this.Identifier = reader.ReadString(reader.ReadInt16()); this.ResourceType = reader.ReadString(16); this.Unknown = reader.ReadInt32(); byte numResources = reader.ReadByte(); while (numResources-- > 0) { ErpFragment res = new ErpFragment(this.ParentFile); res.Read(reader); this.Fragments.Add(res); } if (this.ParentFile.Version > 2) { this.Hash = reader.ReadBytes(16); } }
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); }
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); }