code: @FFDCIgnore(PrivilegedActionException.class)
      public static void writeMessageBody(List<WriterInterceptor> writers,
                                          final Object entity,
                                          final Class<?> type, final Type genericType,
                                          final Annotation[] annotations,
                                          final MediaType mediaType,
                                          final MultivaluedMap<String, Object> httpHeaders,
                                          Message message) throws WebApplicationException, IOException {
  
          final OutputStream entityStream = message.getContent(OutputStream.class);
          if (writers.size() > 1) {
              WriterInterceptor first = writers.remove(0);
              WriterInterceptorContext context = new WriterInterceptorContextImpl(entity,
                                                                                  type,
                                                                              genericType,
                                                                              annotations,
                                                                              entityStream,
                                                                              message,
                                                                              writers);
  
              first.aroundWriteTo(context);
          } else {
              final MessageBodyWriter<Object> writer = ((WriterInterceptorMBW) writers.get(0)).getMBW();
              if (type == byte[].class) {
                  long size = writer.getSize(entity, type, genericType, annotations, mediaType);
                  if (size != -1) {
                      httpHeaders.putSingle(HttpHeaders.CONTENT_LENGTH, Long.toString(size));
                  }
              }
              HttpUtils.convertHeaderValuesToString(httpHeaders, true);
              // Liberty change start
              try {
                  AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                      @Override
                      public Boolean run() throws IOException, WebApplicationException {
                          writer.writeTo(entity, type, genericType, annotations, mediaType,
                                         httpHeaders,
                                         entityStream);
                          return Boolean.TRUE;
                      }
                  });
              } catch (PrivilegedActionException e) {
                  Exception e1 = e.getException();
                  if (e1 instanceof IOException)
                      throw (IOException) e1;
                  else
                      throw (WebApplicationException) e1;
              }
              // Liberty change end
          }
      }
docs: CHECKSTYLE:OFF