@Converter public XMLEventReader createXMLEventReader(InputStream in, Exchange exchange) throws XMLStreamException { XMLInputFactory factory = getInputFactory(); try { return factory.createXMLEventReader(IOHelper.buffered(in), IOHelper.getCharsetName(exchange)); } finally { returnXMLInputFactory(factory); } }
@Converter public XMLEventWriter createXMLEventWriter(OutputStream out, Exchange exchange) throws XMLStreamException { XMLOutputFactory factory = getOutputFactory(); try { return factory.createXMLEventWriter( IOHelper.buffered(out), IOHelper.getCharsetName(exchange)); } finally { returnXMLOutputFactory(factory); } }
@Converter public XMLEventReader createXMLEventReader(File file, Exchange exchange) throws XMLStreamException, FileNotFoundException { XMLInputFactory factory = getInputFactory(); try { return factory.createXMLEventReader( IOHelper.buffered(new FileInputStream(file)), IOHelper.getCharsetName(exchange)); } finally { returnXMLInputFactory(factory); } }