def transform(src, dst, converter,<EOL>overwrite=False, stream=True, chunksize=<NUM_LIT>**<NUM_LIT:2>, **kwargs):
if not overwrite:  <EOL><INDENT>if Path(dst).exists():<EOL><INDENT>raise EnvironmentError("<STR_LIT>" % dst)<EOL><DEDENT><DEDENT>with open(src, "<STR_LIT:rb>") as f_input:<EOL><INDENT>with open(dst, "<STR_LIT:wb>") as f_output:<EOL><INDENT>if stream:<EOL><INDENT>if chunksize > <NUM_LIT> ** <NUM_LIT:2> * <NUM_LIT:10>:<EOL><INDENT>chunksize = <NUM_LIT> ** <NUM_LIT:2> * <NUM_LIT:10><EOL><DEDENT>elif chunksize < <NUM_LIT> ** <NUM_LIT:2>:<EOL><INDENT>chunksize = <NUM_LIT> ** <NUM_LIT:2><EOL><DEDENT>while <NUM_LIT:1>:<EOL><INDENT>content = f_input.read(chunksize)<EOL>if content:<EOL><INDENT>f_output.write(converter(content, **kwargs))<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>else:  <EOL><INDENT>f_output.write(converter(f_input.read(), **kwargs))<EOL><DEDENT><DEDENT><DEDENT>
A file stream transform IO utility function.

:param src: original file path
:param dst: destination file path
:param converter: binary content converter function
:param overwrite: default False,
:param stream: default True, if True, use stream IO mode, chunksize has to
  be specified.
:param chunksize: default 1MB