public void AddAsset(String name, byte[] data) { // TODO Don't add duplicates var record = new AssetRecordHeader(); record.Length = data.Length; record.SetName(name); m_AssetHeaders.Add(record); m_AssetData.Add(data); }
private void AssiociateChuckFromStream(Stream fs) { using (var br = new BinaryReader(fs)) { var count = br.ReadInt32(); for (int i = 0; i < count; i++) { var nameLength = br.ReadInt32(); var name = br.ReadBytes(nameLength); var fileLength = br.ReadInt64(); var offset = br.ReadInt64(); var record = new AssetRecordHeader(); record.SetName(name); record.Length = fileLength; record.Offset = offset; m_Headers.Add(record.GetName(), record); } } }