convert message to Buffer/ArrayBuffer