private static MyClass doWork(byte[] body){
String data = new String(body);
Gson gson = new Gson();
final MyClass myClass = gson.fromJson(data, MyClass .class);
System.out.println("outsideLead"+myClass);
return myClass;
}
byte[] body = {"N":"string","A":"string"}
When i try to convert my Byte[] to object of MyClass type, it throws me a error, that json object is expected instead a json primitive was found. What is the correct way of doing it??