public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException
{
try
{
JsonParser jsonParser = new JsonParserImpl();
JsonHandler jsonHandler = new JsonDefaultHandler();
jsonParser.parse(entityStream, jsonHandler);
JsonValue jsonValue = jsonHandler.getJsonObject();
// jsonValue can be null if stream empty
if (jsonValue == null)
return null;
return new BeanBuilder().createObject(type, jsonValue);