public override void Write(Byte[] buffer, Int32 offset, Int32 count) { lock (this.syncLock) { WaitOnPendingFlush(); bufferStream.Write(buffer, offset, count); if (Length >= bufferSize) Flush(); } }