MultivaluedMap<String, String> headers, InputStream is) throws IOException,
WebApplicationException {
DataFormat format = getValidDataFormat(mt);
try {
@SuppressWarnings("unchecked")
T result = (T)format.unmarshal(null, is);
return result;
} catch (Exception ex) {
throw new BadRequestException(ex);
}
}