Class<?> actualCls = InjectionUtils.getActualType(t);
@SuppressWarnings("unchecked")
MessageBodyWriter<T> writer =
(MessageBodyWriter<T>)providers.getMessageBodyWriter(actualCls, actualCls, anns, mt);
if (writer == null) {
throw new InternalServerErrorException();
}
//TODO: review the possibility of caching the providers
StreamingResponseWriter thewriter =
new StreamingResponseWriter(writer, actualCls, anns, mt, headers, os);
p.writeTo(thewriter);