(self, size=-1)
Reads up to size bytes, with at most one read() system call.
Reads up to size bytes, with at most one read() system call.
Reads up to size bytes with at most one read () system call .
def read1(self, size=-1):
        """Reads up to size bytes, with at most one read() system call."""
        # Returns up to size bytes.  If at least one byte is buffered, we
        # only return buffered bytes.  Otherwise, we do one raw read.
        if size < 0:
            size = self.buffer_size
        if size == 0:
            return b""
        with self._read_lock:
            self._peek_unlocked(1)
            return self._read_unlocked(
                min(size, len(self._read_buf) - self._read_pos))
def read1 ( self , size = - 1 ) : # Returns up to size bytes.  If at least one byte is buffered, we # only return buffered bytes.  Otherwise, we do one raw read. if size < 0 : size = self . buffer_size if size == 0 : return b"" with self . _read_lock : self . _peek_unlocked ( 1 ) return self . _read_unlocked ( min ( size , len ( self . _read_buf ) - self . _read_pos ) )