Reputation: 415
I have the following jsonarray:
{
"_id" :"value",
"data": "value",
"array" : [{
"x" : "value",
"y" : "value"
},
{
"x" : "value",
"y" : "value"
}]
}
How to convert this to byte[] array ?
Upvotes: 2
Views: 7539
Reputation: 958
public byte[] objectToBytArray( Object ob ){
return ((ob.toString()).getBytes());
}
Pass your JSONArray as the object here.
Upvotes: 4