public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException
{
try
{
JsonParserImpl parser = new JsonParserImpl();
JsonDefaultHandler handler = new JsonDefaultHandler();
parser.parse(entityStream, handler);
JsonValue jsonValue = handler.getJsonObject();
if (JsonValue.class.isAssignableFrom(type))
{
// If requested object is JsonValue then stop processing here.