public void Flush(bool final) { if (final && _reader != null) { _reader.WaitEof(5000); } // Dump the rest of the output to variables if (!string.IsNullOrEmpty(_outTo)) { if (_binary) { if (final) { lock (_ms) { _context.OutTo(_outTo, _ms.ToArray()); } } } else { lock (_sbTmp) { string s = _sbTmp.ToString(); _context.OutTo(_outTo, s, true); _sbTmp.Length = 0; } } } }