Search code examples
javastax

StAX createXMLEventReader should I use a BufferedReader?


xmlInputFactory.createXMLEventReader(new FileInputStream(myFile));

Should I use a BufferedReader-decorator for the FIS or is the XMLInputFactory clever enough to decorate the FileInputStream itself?


Solution

  • seems like you should be able to test this pretty easily. try with and without a BufferedInputStream and see which one is faster. in general, adding extra BufferedInputStreams does not usually add much overhead as they are designed to handle this situation gracefully.