public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException
{
try
{
JAXBContext jaxb = findJAXBContext(type, annotations, mediaType, true);
Unmarshaller unmarshaller = jaxb.createUnmarshaller();
Object obj = unmarshaller.unmarshal(entityStream);
if (obj instanceof JAXBElement)
{
JAXBElement element = (JAXBElement) obj;
return element.getValue();