我如何修改现有的字节数组,如果我的条件满足,我可以附加“空格”或“0”
for example ::
last 2 byte Hex value if E0 in decimal is -32
byte1 [] = [48, 16, 6, 11, 43, 6, 1, 2, 1, 69, 1, 2, 1, 6, 9, 4, 1, -32]
last 1byte 101=e 48=0
byte2[]=[48, 17, 6, 11, 43, 6, 1, 2, 1, 69, 1, 2, 1, 6, 9, 4, 2, 101, 48]
我怎么知道字节数组中的最后一个索引是 2 字节,十六进制本身还是 1 字节,如果这是十六进制,那么我需要在字节数组上添加“0”或“空格”
In precise : the last character need to be checked
byte b = byte1[18]
check this whether it's one byte or 2 byte if it come as "e0" then 2 byte if it's come as "0" then modify the byte array to contain extra "0"