async def dump_blob(writer, elem, elem_type, params=None):
    """
    Dumps blob to a binary stream

    :param writer:
    :param elem:
    :param elem_type:
    :param params:
    :return:
    """
    elem_is_blob = isinstance(elem, x.BlobType)
    data = bytes(getattr(elem, x.BlobType.DATA_ATTR) if elem_is_blob else elem)
    await dump_varint(writer, len(elem))
    await writer.awrite(data)