/**
- * The output stream to which data will be written prior to the theshold
+ * The output stream to which data will be written prior to the threshold
* being reached.
*/
private ByteArrayOutputStream memoryOutputStream;
/**
- * The output stream to which data will be written after the theshold is
- * reached.
- */
- private FileOutputStream diskOutputStream;
-
-
- /**
* The output stream to which data will be written at any given time. This
* will always be one of <code>memoryOutputStream</code> or
* <code>diskOutputStream</code>.
byte[] data = memoryOutputStream.toByteArray();
FileOutputStream fos = new FileOutputStream(outputFile);
fos.write(data);
- diskOutputStream = fos;
currentOutputStream = fos;
memoryOutputStream = null;
}