Thrift - converting from simple JSON
问题 I created the following Thrift Object: struct Student{ 1: string id; 2: string firstName; 3: string lastName } Now I would like to read this object from JSON. According to this post this is possible So I wrote the following code: String json = "{\"id\":\"aaa\",\"firstName\":\"Danny\",\"lastName\":\"Lesnik\"}"; StudentThriftObject s = new StudentThriftObject(); byte[] jsonAsByte = json.getBytes("UTF-8"); TMemoryBuffer memBuffer = new TMemoryBuffer(jsonAsByte.length); memBuffer.write(jsonAsByte