def METHOD_NAME(self, data: Union[int, bytes]) -> bool:
    """Check if data (or amount of data) fits in the buffer.
    This method is purely for convenience.
    """
    in_size = len(data) if isinstance(data, bytes) else data
    return (len(self._buffer) + in_size) <= self._buffer_size