private bool IsInputRemaining() { // is there any input in the buffer? if (this._inputBufferRemaining > 0) { return true; } // try to fill it if not DoReadBuffer(); // true if input now available return this._inputBufferRemaining > 0; }