def return_bytearray(func):
    """
    Decorator to convert a function's returned value to a bytearray
    """
    def wrapped(*args, **kwargs):
        return bytearray(func(*args, **kwargs))
    return wrapped