private void FlushWriteBuffer() { AssertBufferInvariants(); if (_writePos > 0) { WriteNative(GetBuffer(), 0, _writePos); _writePos = 0; } }