/**
* Called from inside _logLock
*/
private void flushTempStream()
{
TempStreamApi ts = _tempStream;
_tempStream = null;
_tempStreamSize = 0;
try {
if (ts != null) {
if (_os == null)
openLog();
try {
ReadStream is = ts.openRead();
try {
is.writeToStream(_os);
} finally {
is.close();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
ts.destroy();
}
}
} finally {
_logLock.notifyAll();
}