diff --git a/src/java/com/threerings/cast/bundle/tools/DumpComponentMap.java b/src/java/com/threerings/cast/bundle/tools/DumpComponentMap.java new file mode 100644 index 000000000..0aeb8ee24 --- /dev/null +++ b/src/java/com/threerings/cast/bundle/tools/DumpComponentMap.java @@ -0,0 +1,46 @@ +// +// $Id: DumpComponentMap.java,v 1.1 2002/04/11 01:34:09 mdb Exp $ + +package com.threerings.cast.bundle.tools; + +import java.io.BufferedInputStream; +import java.io.DataInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +import java.util.Iterator; + +import com.threerings.cast.bundle.tools.ComponentBundlerTask.HashMapIDBroker; + +/** + * Dumps the serialized component map generated by the component bundling + * task. + */ +public class DumpComponentMap +{ + public static void main (String[] args) + { + if (args.length < 1) { + System.err.println("Usage: DumpComponentMap mapfile"); + System.exit(-1); + } + + HashMapIDBroker broker = new HashMapIDBroker(); + try { + FileInputStream fin = new FileInputStream(args[0]); + DataInputStream din = + new DataInputStream(new BufferedInputStream(fin)); + broker.readFrom(din); + + Iterator entries = broker.entrySet().iterator(); + while (entries.hasNext()) { + System.out.println(entries.next()); + } + + } catch (Exception e) { + System.err.println("Error loading component ID map " + + "[mapfile=" + args[0] + "]: " + e); + } + } +}