protected <T2> Object readFrom(Class<T2> type, Type genericType,
MediaType media, Annotation[] annotations)
{
try
{
ReaderUtility reader = new ReaderUtility(providerFactory,
messageBodyReaderInterceptors)
{
@Override
public RuntimeException createReaderNotFound(Type genericType,
MediaType mediaType)
{
return createResponseFailure(format(
"Unable to find a MessageBodyReader of content-type %s and type %s",
mediaType, genericType));
}
};
return reader.doRead(type, genericType == null ? type : genericType,
media, this.annotations, getHeaders(), streamFactory
.getInputStream());
}
catch (IOException e)
{