async def dump_blob(writer, elem, elem_type, params=None):
elem_is_blob = isinstance(elem, BlobType)<EOL>elem_params = elem if elem_is_blob or elem_type is None else elem_type<EOL>data = bytes(getattr(elem, BlobType.DATA_ATTR) if elem_is_blob else elem)<EOL>if not elem_params.FIX_SIZE:<EOL><INDENT>await dump_uvarint(writer, len(elem))<EOL><DEDENT>elif len(data) != elem_params.SIZE:<EOL><INDENT>raise ValueError('<STR_LIT>' % elem_params.SIZE)<EOL><DEDENT>await writer.awrite(data)<EOL>
Dumps blob message to the writer.
Supports both blob and raw value.

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