public static void setCharset(MediaType mediaType, Marshaller marshaller) throws PropertyException { String charset = getCharset(mediaType); // specify the character encoding if it is set on the media type if (charset != null) { marshaller.setProperty(Marshaller.JAXB_ENCODING, charset); } else { marshaller.setProperty(Marshaller.JAXB_ENCODING, StandardCharsets.UTF_8.name()); } }
return processWithSecureProcessing(unmarshaller, entityStream, getCharset(mediaType)); if (getCharset(mediaType) == null)