code: @Override
      public ODataEntity<?> readFrom(Class<ODataEntity<?>> type,
              Type genericType, Annotation[] annotations, MediaType mediaType,
              MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
              throws IOException {
  
          ODataEntity<?> result = null;
          String responseType = mediaType.getParameters().get("type");
          try {
              if (responseType == null || responseType.equals("feed")) {
                  List<ODataEntity<?>> feedContents = null;
                  synchronized (unmarshaller) {
                      feedContents = unmarshaller.unmarshalFeed(entityStream,
                              type);
                  }
                  return feedContents.get(0);
              } else if (responseType.equals("entry")) {
                  synchronized (unmarshaller) {
                      result = unmarshaller.unmarshalEntry(entityStream, type);
                  }
              } else {
                  throw new RuntimeException();
              }
          } catch (JAXBException e) {
              throw new RuntimeException(e);
          } catch (ServiceException e) {
              throw new RuntimeException(e);
          }
  
          return result;
      }
docs: /*
  (non-Javadoc)
  
  @see javax.ws.rs.ext.MessageBodyReader#readFrom(java.lang.Class,
  java.lang.reflect.Type, java.lang.annotation.Annotation[],
  javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap,
  java.io.InputStream)