Use memory-optimized ByteArrayOutputStream from Commons IO instead of the dumb implementation from the JDK.