def dataReceived(self, rbuffer):
        """
        @param rbuffer: Data received.
        @type rbuffer: L{bytes} or L{bytearray}
        """
        if isinstance(rbuffer, bytes):
            pass
        elif isinstance(rbuffer, bytearray):
            # XXX: some day, we'll have protocols that can handle raw buffers
            rbuffer = bytes(rbuffer)
        else:
            raise TypeError("data must be bytes or bytearray, not " +
                            type(rbuffer))

        self.protocol.dataReceived(rbuffer)

        @param rbuffer: Data received.
        @type rbuffer: L{bytes} or L{bytearray}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/iocpreactor/tcp.py