示例#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);
   }
 }
示例#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);
   }
 }
示例#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);
   }
 }