public bool Open(Stream fs) { var reader = ArchiveFactory.Open(fs); foreach (var entry in reader.Entries) if (entry.FilePath.EndsWith(".3ds") || entry.FilePath.EndsWith(".cci") || entry.FilePath.EndsWith(".csu")) { _cciName = entry.FilePath; _crc = entry.Crc; CCIContext = new CCIContext(); var entryStream = entry.OpenEntryStream(); var tempStream = new MemoryStream(); //read only the first 0x5000 bytes var buffer = new byte[0x5000]; entryStream.Read(buffer, 0, buffer.Length); tempStream.Write(buffer,0,buffer.Length); tempStream.Seek(0, SeekOrigin.Begin); CCIContext.Open(tempStream); break; } return true; }
public bool Open(Stream fs) { var reader = ArchiveFactory.Open(fs); foreach (var entry in reader.Entries) { if (entry.FilePath.EndsWith(".3ds") || entry.FilePath.EndsWith(".cci") || entry.FilePath.EndsWith(".csu")) { _cciName = entry.FilePath; _crc = entry.Crc; CCIContext = new CCIContext(); var entryStream = entry.OpenEntryStream(); var tempStream = new MemoryStream(); //read only the first 0x5000 bytes var buffer = new byte[0x5000]; entryStream.Read(buffer, 0, buffer.Length); tempStream.Write(buffer, 0, buffer.Length); tempStream.Seek(0, SeekOrigin.Begin); CCIContext.Open(tempStream); break; } } return(true); }