App { public static MTEF parse(InputStream is) throws ParseException, IOException { PushbackInputStream pis = new PushbackInputStream(is); pis.read(new byte[28]); return new MTEFParser().parse(pis); }  static MTEF parse(InputStream is);  }
@Test public void testParseQuadratic() throws ParseException, IOException { InputStream is = AppTest.class.getResourceAsStream("/ole/quadratic.bin"); MTEF mtef = App.parse(is); assertEquals("Windows", mtef.getGeneratingPlatform()); XmlGeneratorVisitor visitor = new XmlGeneratorVisitor(); mtef.accept(visitor); Element root = visitor.getRoot(); log.debug(root.toXML()); Files.write(root.toXML(), new File("output.xml"), Charset.forName("UTF-8")); }
@Test public void testParseFraction() throws ParseException, IOException { InputStream is = AppTest.class.getResourceAsStream("/ole/fraction.bin"); MTEF mtef = App.parse(is); assertEquals("Windows", mtef.getGeneratingPlatform()); XmlGeneratorVisitor visitor = new XmlGeneratorVisitor(); mtef.accept(visitor); Element root = visitor.getRoot(); log.debug(root.toXML()); }