use of com.googlecode.protobuf.format.JsonFormat in project tutorials by eugenp.
the class ApplicationIntegrationTest method convertProtobufMessageStreamToJsonString.
private String convertProtobufMessageStreamToJsonString(InputStream protobufStream) throws IOException {
JsonFormat jsonFormat = new JsonFormat();
Course course = Course.parseFrom(protobufStream);
return jsonFormat.printToString(course);
}
Aggregations