< prev index next >

test/javax/xml/jaxp/unittest/stream/XMLEventWriterTest/ReaderToWriterTest.java

Print this page




 197             InputStream in = util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE));
 198             OutputStream out = new FileOutputStream(OUTPUT_FILE);
 199 
 200             XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
 201             XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out);
 202 
 203             writeEvents(reader, writer);
 204             checkOutput(OUTPUT_FILE);
 205 
 206         } catch (Exception e) {
 207             e.printStackTrace();
 208             Assert.fail("Exception occured: " + e.getMessage());
 209         } finally {
 210             File file = new File(OUTPUT_FILE);
 211             if (file.exists())
 212                 file.delete();
 213         }
 214     }
 215 
 216 }
 217 


 197             InputStream in = util.BOMInputStream.createStream("UTF-16BE", this.getClass().getResourceAsStream(INPUT_FILE));
 198             OutputStream out = new FileOutputStream(OUTPUT_FILE);
 199 
 200             XMLEventReader reader = XML_INPUT_FACTORY.createXMLEventReader(in);
 201             XMLEventWriter writer = XML_OUTPUT_FACTORY.createXMLEventWriter(out);
 202 
 203             writeEvents(reader, writer);
 204             checkOutput(OUTPUT_FILE);
 205 
 206         } catch (Exception e) {
 207             e.printStackTrace();
 208             Assert.fail("Exception occured: " + e.getMessage());
 209         } finally {
 210             File file = new File(OUTPUT_FILE);
 211             if (file.exists())
 212                 file.delete();
 213         }
 214     }
 215 
 216 }

< prev index next >