protected Stream UnpackEntry(Stream input, NsaEntry nsa_entry) { if (null == nsa_entry) { return(input); } if (nsa_entry.Name.HasExtension(".nbz")) { input.Position = 4; return(new BZip2InputStream(input)); } if (!(Compression.LZSS == nsa_entry.CompressionType || Compression.SPB == nsa_entry.CompressionType)) { return(input); } using (input) { var decoder = new Unpacker(input, nsa_entry.UnpackedSize); if (Compression.SPB == nsa_entry.CompressionType) { return(decoder.SpbDecodedStream()); } else { return(decoder.LzssDecodedStream()); } } }
protected Stream UnpackEntry(Stream input, NsaEntry nsa_entry) { if (null == nsa_entry || !(Compression.LZSS == nsa_entry.CompressionType || Compression.SPB == nsa_entry.CompressionType)) { return(input); } using (input) { var decoder = new Unpacker(input, nsa_entry.UnpackedSize); if (Compression.SPB == nsa_entry.CompressionType) { return(decoder.SpbDecodedStream()); } else { return(decoder.LzssDecodedStream()); } } }
protected Stream UnpackEntry(Stream input, NsaEntry nsa_entry) { if (null == nsa_entry || !(Compression.LZSS == nsa_entry.CompressionType || Compression.SPB == nsa_entry.CompressionType)) return input; using (input) { var decoder = new Unpacker (input, nsa_entry.UnpackedSize); if (Compression.SPB == nsa_entry.CompressionType) return decoder.SpbDecodedStream(); else return decoder.LzssDecodedStream(); } }