public static OMAConstructed unmarshal(InputStream in) throws IOException { OMANode node = buildNode(in, null); if (node == null || node.isLeaf()) { throw new IOException("Bad OMA tree"); } unmarshal(in, (OMAConstructed) node); return (OMAConstructed) node; }
private static void unmarshal(InputStream in, OMAConstructed parent) throws IOException { for (; ; ) { OMANode node = buildNode(in, parent); if (node == null) { return; } else if (!node.isLeaf()) { unmarshal(in, (OMAConstructed) node); } } }