What is the most effective (performance-wise) and clean way to perform the transformation of taking up to 500 XML files, sized up to 50 Mb each and making a single String out of them. All files are XML and need to keep the formatting etc.
I'm currently doing the reading using XMLEventReader , and then XMLEventWriter,reading one event at a time and using StringBuilder to concatenate all the String results. Then making it into a String at the end of the method, but this crashes due to lack of Java heap space in the IDE, way before 500 files...
Thanks !