Once in a while during development a software engineer needs to embed the binary object as byte array in C or Java language. While coding a solution is simple, it could be achieved by the following command line on Linux or cygwin:
For unsigned data:
od -v -t u1 <binary file> | cut -c9- | sed 's/\([0-9]\+\)/\1,/g'
For signed data (Java byte arrays):
od -v -t d1 <binary file> | cut -c9- | sed 's/\([0-9]\+\)/\1,/g'