I am using Jersey and I am trying to access the responset body in my method very similar to this question:
How do I read response body for a RESTful service using Jersey?
Body value send i with Postman.
@Provider
@PreMatching
public class LoggingFilter implements ContainerRequestFilter, ContainerResponseFilter
{
    final Logger logger = Logger.getLogger(LoggingFilter.class);
    @Override
        public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
        {
            logger.info("------------------------------------------------------------");
            logger.info("Container-Response");
            logger.info("Status: " + responseContext.getStatus());
            for (Map.Entry<String, List<Object>> entry : responseContext.getHeaders().entrySet())
            {
                logger.info(entry.getKey() + ":" + entry.getValue().toString());
            }
            BufferedReader br;
            try
            {
                br = new BufferedReader(new InputStreamReader((InputStream) responseContext.getEntity(), "UTF-8"));
                        StringBuilder xml = new StringBuilder();
                String line;
                while ((line = br.readLine()) != null)
                {
                    xml.append(line);
                }
                logger.info(xml);
                responseContext.setEntity(new ByteArrayInputStream(xml.toString().getBytes("UTF-8")));
            } catch (IOException e)
            {
                e.printStackTrace();
            }
        }
 }
Error: Mai 04, 2017 9:52:55 AM org.apache.catalina.core.StandardWrapperValve invoke SCHWERWIEGEND: Servlet.service() for servlet [Jersey REST Service] in context with path [/update] threw exception [java.lang.ClassCastException: de.beracom.update.UpdateInformation cannot be cast to java.io.InputStream] with root cause java.lang.ClassCastException: de.beracom.update.UpdateInformation cannot be cast to java.io.InputStream at de.beracom.update.LoggingFilter.filter(LoggingFilter.java:92) .....