Example #1
0
 @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);
   }
 }
Example #2
0
 @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);
   }
 }
Example #3
0
 @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);
   }
 }