async def dump_blob(elem, elem_type=None):
elem_is_blob = isinstance(elem, x.BlobType)<EOL>data = getattr(elem, x.BlobType.DATA_ATTR) if elem_is_blob else elem<EOL>if data is None or len(data) == <NUM_LIT:0>:<EOL><INDENT>return b'<STR_LIT>'<EOL><DEDENT>if isinstance(data, (bytes, bytearray, list)):<EOL><INDENT>return base64.b16encode(bytes(data))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Dumps blob message.
Supports both blob and raw value.

:param writer:
:param elem:
:param elem_type:
:param params:
:return: