main:copy bytes to string, the string must have the length parameter, or it will lost data when there is a 0 at the middle of bytes