示例#1
0
文件: ArcNSA.cs 项目: tuchang/GARbro
 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());
         }
     }
 }
示例#2
0
文件: ArcNSA.cs 项目: uboaa/GARbro
 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());
         }
     }
 }
示例#3
0
文件: ArcNSA.cs 项目: Casidi/GARbro
 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();
     }
 }