Added simple tool for dumping the serialized component map.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1230 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user