question: @ Override protected void thresholdReached ( ) throws IOException { if ( prefix != null ) { outputFile = File . createTempFile ( prefix , suffix , directory ) ; } FileOutputStream fos = new FileOutputStream ( outputFile ) ; memoryOutputStream . writeTo ( fos ) ; currentOutputStream = fos ; memoryOutputStream = null ; }
target:  Switches the underlying output stream from a memory based stream to one that is backed by disk. This is the point at which we realise that too much data is being written to keep in memory, so we elect to switch to disk-based storage.