class ContentSupport {

  byte[] toJsonBytes(Message message) {
    try {
      String json = JsonFormat.printer().preservingProtoFieldNames().print(message);
      return json.getBytes(StandardCharsets.UTF_8);
    } catch (Exception e) {
      throw new FeatureException(Problem.localProblem(e.getMessage(), ""), e);
    }
  }

}