private void SetupWrite() { if ((!CanWrite)) throw new NotSupportedException("Write not supported."); if (!_bufferOwnedByWrite) { FlushReadBuffer(); _bufferOwnedByWrite = true; } }