public override Stream OpenEntry(ArcFile arc, Entry entry) { var input = arc.File.CreateStream(entry.Offset, entry.Size); if (entry.Size <= 8) { return(input); } var sign = input.Signature; if (0x32434c5a != sign) // 'ZLC2' { return(input); } using (input) using (var reader = new Zlc2Reader(input, (int)entry.Size)) { reader.Unpack(); return(new BinMemoryStream(reader.Data, entry.Name)); } }
public override Stream OpenEntry(ArcFile arc, Entry entry) { var input = arc.File.CreateStream(entry.Offset, entry.Size); if (entry.Size <= 8) { return(input); } var sign = FormatCatalog.ReadSignature(input); if (0x32434c5a != sign) // 'ZLC2' { input.Position = 0; return(input); } using (input) using (var reader = new Zlc2Reader(input, (int)entry.Size)) { reader.Unpack(); return(new MemoryStream(reader.Data)); } }
public override Stream OpenEntry(ArcFile arc, Entry entry) { var input = arc.File.CreateStream (entry.Offset, entry.Size); if (entry.Size <= 8) return input; var sign = FormatCatalog.ReadSignature (input); if (0x32434c5a != sign) // 'ZLC2' { input.Position = 0; return input; } using (input) using (var reader = new Zlc2Reader (input, (int)entry.Size)) { reader.Unpack(); return new MemoryStream (reader.Data); } }