Package mwt.wow.mpq

Examples of mwt.wow.mpq.MpqArchive


  /**
   * Read in the archive!
   * @throws IOException
   */
  public void parseFile() throws IOException {
    mpqArchive = new MpqArchive(mpqFile);
    mpqArchive.readExtData();
    parsed=true;
  }
View Full Code Here


    File mpqFile = new File(args[0]);
    File dir = new File(args[1]);
    dir.mkdirs();
   
    long start = System.currentTimeMillis();
    ReadMpqArchive mpqArchive = new MpqArchive(mpqFile);
    mpqArchive.readExtData();
    Collection<String> names = mpqArchive.listFileNames();
    for (String name : names) {
      File dest = new File(dir, name);
      if (dest.exists()) {
        continue;
      }
      dest.getParentFile().mkdirs();
      mpqArchive.getFile(name, null, null).extractTo(dest);
    }
    mpqArchive.close();
    long end = System.currentTimeMillis();
    System.out.println("Took: " + (end - start) + "ms");
  }
View Full Code Here

    dir.mkdirs();

    mpqFile.delete();

    long start = System.currentTimeMillis();
    ReadWriteMpqArchive mpqArchive = new MpqArchive(mpqFile, true);
    int count = countFiles(dir);
    int hashTableSize = Integer.highestOneBit(count * 4 / 3) << 1;
    mpqArchive.initHashtable(hashTableSize);
    addDir(mpqArchive, dir, "");
    mpqArchive.saveMetadata();
    mpqArchive.close();
    long end = System.currentTimeMillis();
    System.out.println("Took: " + (end - start) + "ms");
  }
View Full Code Here

public class DumpMpqStructure {

  public static void main(String[] args) throws IOException {
    File mpqFile = new File(args[0]);
    MpqArchive mpqArchive = new MpqArchive(mpqFile);
    mpqArchive.readExtData();
    mpqArchive.dump(args.length > 1 ? new PrintStream(new File(args[1]))
        : System.out);
    mpqArchive.close();
  }
View Full Code Here

TOP

Related Classes of mwt.wow.mpq.MpqArchive

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.