Historically several classes from Commons-IO have been embedded into POI. Additionally Commons-IO provides a ByteArrayOutputStream which is based on a list instead of reallocating whole memory chunks. As a base measurement, I've used the build times on my PC, which are about 3% faster now (before 577 sec / after 561 sec). Arguably the tests use a lot of byte juggling and reloading of documents and hence it probably will have less of an effect on production code. Although we have the usual suspects on stackoverflow, who still have problems with collecting the dependencies in the area of dependency managers, one more dependency - which is kind of a standard dependency - doesn't hurt in my point of view. I've mass-replaced the java.io.ByteArrayOutputStream with the unsynchronized commons counterpart and then went through all the files to check, if .toInputStream() can be used instead of new ByteArrayInputStream(...toByteArray()). I had to exclude the HWPF classes, as those have java.io.BAOS in their API. Additionally I've cleaned up the usage of AutoClosables and a few incorrect tests, which haven't updated the test objects after reloading the documents.
Applied via r1889871