Optimize OnRead function of Connection.