@Override
	protected void thresholdReached(final int current, final int predicted) throws IOException {
		// Open a temp file, write the byte array version, and swap the
		// output stream to the file version.

		var attr = PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"));
		var outFilePath = Files.createTempFile(TMPFILE_PREFIX, TMPFILE_SUFFIX, attr);
		this.outFile = outFilePath.toFile();
		this.outFileStream = new FileOutputStream(this.outFile);

		((ByteArrayOutputStream) this.output).writeTo(this.outFileStream);
		this.output = new BufferedOutputStream(this.outFileStream);
	}
@param transitionSize is the number of bytes at which to convert from a byte
                      array to a real file.
src/main/java/de/gessnerfl/fakesmtp/smtp/io/DeferredFileOutputStream.java