I have a Byte array being returned in my JSON
.
JSON
[{"template":167,255,1,30,179,0,218,0,2,88,1,184,0],
"template2":null,
"template3":null,
"Client_Id":1160739}]
In Java, how can I recover this byte array ?
I try return a String in JSON
instead the byte array, but when I convert to byte, it will change the value that I need. Example, 167 is the value that I need because this is already the byte value, but if I try to convert 167 to byte, it will return another value, so I need recover it as byte value.
JAVA
ArrayList<JSONObject> vetor = ArrayJson(client);
byte[] template = (byte[])vetor.get(0).get("template");
I'm using the json.org/java repository to construct the json helper class.