add binary conversion support to copy2buffer
add field length and message length parsing