set gen print to bytes buffer instead of stdout; format bytes buffer