Here is a little problem: I want to create a byte stream (a table of byte integer) from different data type, integer of variable length, string.
val1 = 0x2
val2 = 0x0001020304050607
val3 = "blablabla"
And I want to obtain a stream like:
byteStream = val1 + val2 + val3
byteStream = [0x02, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x62, 0x6c, 0x61, 0x62, 0x6c, 0x61, 0x62, 0x6c, 0x61]
I have tried several things, like using a intermediate string and then convert this in byte. But this solution is ugly, and does not work properly.
Any help welcomed. Thanks.