// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.HashMap;

public class Test {
   public static void main(String[] args) throws Exception {
      HashMap hm = new HashMap();
      hm.put("i", new Integer(123));
      hm.put("fp", new Double(456.789));
      hm.put("s", "This is a test");
      hm.put("cl", new Foobar("1 2"));
      ByteArray ba = new ByteArray();
      byte[] bad = { 1, 2, 3, 4, 79, -127, -1 };
      ba.setData(bad);
      hm.put("ba", ba);
      System.out.println(hm);
      HashMap2XML.save(hm, "test.xml");
      HashMap hm2 = XML2HashMap.load("test.xml");
      System.out.println(hm2);
      ByteArray ba2 = (ByteArray)hm2.get("ba");
      byte[] bad2 = ba2.getData();
      System.out.println(bad2[0]);
      System.out.println(bad2[1]);
      System.out.println(bad2[2]);
      System.out.println(bad2[3]);
      System.out.println(bad2[4]);
      System.out.println(bad2[5]);
      System.out.println(bad2[6]);
   }
}
