Ejemplo n.º 1
0
 /// <summary>
 ///  Extracts the ZT package from the open KIFINT archive stream.
 /// </summary>
 /// <param name="entry">The entry to extract from.</param>
 /// <param name="kifintStream">The stream to the open KIFINT archive.</param>
 /// <returns>The extracted ZT package.</returns>
 ///
 /// <exception cref="ArgumentNullException">
 ///  <paramref name="entry"/> or <paramref name="kifintStream"/> is null.
 /// </exception>
 public static ZtPackage ExtractZt(this KifintEntry entry, KifintStream kifintStream)
 {
     if (entry == null)
     {
         throw new ArgumentNullException(nameof(entry));
     }
     using (var stream = entry.ExtractToStream(kifintStream))
         return(ZtPackage.Extract(stream, entry.FileName));
 }
Ejemplo n.º 2
0
 /// <summary>
 ///  Extracts the ZT package from the entry and saves the contained files to the output directory.
 /// </summary>
 /// <param name="entry">The entry to extract from.</param>
 /// <returns>The extracted ZT package.</returns>
 /// <param name="outputDir">The output directory to save the package files to.</param>
 ///
 /// <exception cref="ArgumentNullException">
 ///  <paramref name="entry"/> or <paramref name="outputDir"/> is null.
 /// </exception>
 public static ZtPackage ExtractZtAndFiles(this KifintEntry entry, string outputDir)
 {
     if (entry == null)
     {
         throw new ArgumentNullException(nameof(entry));
     }
     using (var stream = entry.ExtractToStream())
         return(ZtPackage.ExtractFiles(stream, entry.FileName, outputDir));
 }