private static byte[] toByteArray(Object template) throws IOException {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    writeTo(template, out);
    return out.toByteArray();
  }
Deserializes a JSON object list from a JSON string.

@param <T> child type of {@link JsonTemplate}
@param jsonString a JSON string
@param templateClass the template to deserialize the string to
@return the template filled with the values parsed from {@code jsonString}
@throws IOException if an error occurred during parsing the JSON
jib-core/src/main/java/com/google/cloud/tools/jib/json/JsonTemplateMapper.java