Checks when we the reader can continue to read.
7920
private boolean canContinueReading() throws IOException, InterruptedException {
        //If the reader is not ready, gives it some milliseconds
        //It is important to do that, because the ready method guarantees that the readline will not be blocking
        if (!this.reader.ready()) {
            Thread.sleep(this.waitPause);
        }

        //If not ready yet, wait a moment to make sure it is finished
        if (!this.reader.ready()) {
            Thread.sleep(50);
        }

        return this.reader.ready();
    }
96944
def _wait_event(self, reading):
        ""
        with self._registered(reading, not reading):
            (self._readable if reading else self._writable).wait()

        if scheduler.state.interrupted:
            raise IOError(errno.EINTR, "interrupted system call")
724335
protected function onRead()
    {
        if (!empty($this->boundary)) {
            $this->req->attrs->input->parseMultipart();
        }
        if (($this->req->attrs->contentLength <= $this->readed) && !$this->EOF) {
            $this->sendEOF();
        }
    }
1208540
public final boolean isReadOnly() {
        Entry<?> entry = getEntry();
        Calendar calendar = entry.getCalendar();
        if (calendar != null) {
            return calendar.isReadOnly();
        }

        return false;
    }
1140427
def _check(self): # TODO: fix?
        """"""
        if self._returncode:
            rarfile.check_returncode(self, '')
        if self._remain != 0:
            raise rarfile.BadRarFile("Failed the read enough data")
1105802
private boolean isReadOnly(Session session, String path)
   {
      try
      {
         session.checkPermission(path, PermissionType.SET_PROPERTY);
         return false;
      }
      catch (AccessControlException e)
      {
         return true;
      }
      catch (RepositoryException e)
      {
         return false;
      }
   }
1010791
protected void checkIdle ()
    {
        long now = getTimeStamp();

        switch (_state) {
        case ACTIVE:
            // check whether they've idled out
            if (now >= (_lastEvent + _toIdleTime)) {
                log.info("User idle for " + (now-_lastEvent) + "ms.");
                _state = IDLE;
                idledOut();
            }
            break;

        case IDLE:
            // check whether they've been idle for too long
            if (now >= (_lastEvent + _toIdleTime + _toAbandonTime)) {
                log.info("User idle for " + (now-_lastEvent) + "ms. " +
                         "Abandoning ship.");
                _state = ABANDONED;
                abandonedShip();
            }
            break;
        }
    }
294061
protected int checkRead(int offset, int length) {
    checkOffset(offset);
    if (limit == -1) {
      if (offset + length > capacity) {
        if (capacity < maxCapacity) {
          if (this.offset + offset + length <= bytes.size()) {
            capacity = bytes.size() - this.offset;
          } else {
            capacity(calculateCapacity(offset + length));
          }
        } else {
          throw new BufferUnderflowException();
        }
      }
    } else {
      if (offset + length > limit) {
        throw new BufferUnderflowException();
      }
    }
    return offset(offset);
  }
1172790
def closed(self):
        """"""
        closed = self._closing or self._closed
        if not closed and self._reader and self._reader.at_eof():
            self._closing = closed = True
            self._loop.call_soon(self._do_close, None)
        return closed
637888
@Override
    public boolean deregisterEarlyRead() {
        // LI4335.2
        if (!this.bEarlyReads) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "User tried to deregister non-existent early read");
            }
            return false;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "User deregistering early read interest");
        }
        this.bEarlyReads = false;
        // not sure if any read is actually outstanding but just in case...
        super.cancelOutstandingRead();

        if (isMessageSent()) {
            // finishRequest has been called already
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Error: full request already sent");
            }
            return false;
        }
        return true;
    }
171889
def resume_writing(self):
        ''''''
        if not self._can_send.is_set():
            self._can_send.set()
            self.transport.resume_reading()
1308308
void releaseReadSuspended(ChannelHandlerContext ctx) {
        Channel channel = ctx.channel();
        channel.attr(READ_SUSPENDED).set(false);
        channel.config().setAutoRead(true);
    }
1132754
protected boolean lookahead() {
        try {
            next = this.reader.readLine();
            if(next == null) {
                // TODO: make this close-on-exhaust optional?
                reader.close();
            }
            return (next!=null);
        } catch (IOException e) {
            logger.warning(e.toString());
            return false;
        }
    }
1319386
public function isReadableForCurrentMember()
	{
		if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_ALL)
		{
			return true;
		}
		else if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_LOGGED_USER && FE_USER_LOGGED_IN)
		{
			return true;
		}
		else if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_CUSTOM && FE_USER_LOGGED_IN)
		{
			return $this->isAccessibleForCurrentMember(\AccessRight::READ);
		}
		else if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_INHERIT && $this->hasParentCategory())
		{
			return $this->parentCategory->isReadableForCurrentMember();
		}
		return false;
	}
730488
def check_keepalive(self):
        """"""
        if self.sock != NC.INVALID_SOCKET and time.time() - self.last_msg_out >= self.keep_alive:
            if self.state == NC.CS_CONNECTED:
                self.send_pingreq()
            else:
                self.socket_close()
1182675
def read_until_yieldable(self):
        """"""
        while not self.yieldable():
            read_content, read_position = _get_next_chunk(self.fp, self.read_position, self.chunk_size)
            self.add_to_buffer(read_content, read_position)
1201465
public boolean hasNext() {
        // check if we already fetched next item
        if (next != null) {
            return true;
        }

        // check if result set already finished
        if (resultSetFinished) {
            return false;
        }

        // now fetch next item
        next = safeReadNext();

        // check if we got something
        if (next != null) {
            return true;
        }

        // no more items
        resultSetFinished = true;

        return false;
    }