@SuppressWarnings("unchecked")
  public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException {
    """
	Reads the next JSON value from {@code reader} and convert it to an object
	of type {@code typeOfT}.
	Since Type is not parameterized by T, this method is type unsafe and should be used carefully
	
	@throws JsonIOException if there was a problem writing to the Reader
	@throws JsonSyntaxException if json is not a valid representation for an object of type
    """
    boolean isEmpty = true;
    boolean oldLenient = reader.isLenient();
    reader.setLenient(true);
    try {
      reader.peek();
      isEmpty = false;
      TypeAdapter<T> typeAdapter = (TypeAdapter<T>) getAdapter(TypeToken.get(typeOfT));
      return typeAdapter.read(reader);
    } catch (EOFException e) {
      /*
       * For compatibility with JSON 1.5 and earlier, we return null for empty
       * documents instead of throwing.
       */
      if (isEmpty) {
        return null;
      }
      throw new JsonSyntaxException(e);
    } catch (IllegalStateException e) {
      throw new JsonSyntaxException(e);
    } catch (IOException e) {
      // TODO(inder): Figure out whether it is indeed right to rethrow this as JsonSyntaxException
      throw new JsonSyntaxException(e);
    } finally {
      reader.setLenient(oldLenient);
    }
  }
@SuppressWarnings("unchecked")
  public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException {
    boolean isEmpty = true;
    boolean oldLenient = reader.isLenient();
    reader.setLenient(true);
    try {
      reader.peek();
      isEmpty = false;
      TypeAdapter<T> typeAdapter = (TypeAdapter<T>) getAdapter(TypeToken.get(typeOfT));
      return typeAdapter.read(reader);
    } catch (EOFException e) {
      /*
       * For compatibility with JSON 1.5 and earlier, we return null for empty
       * documents instead of throwing.
       */
      if (isEmpty) {
        return null;
      }
      throw new JsonSyntaxException(e);
    } catch (IllegalStateException e) {
      throw new JsonSyntaxException(e);
    } catch (IOException e) {
      // TODO(inder): Figure out whether it is indeed right to rethrow this as JsonSyntaxException
      throw new JsonSyntaxException(e);
    } finally {
      reader.setLenient(oldLenient);
    }
  }
@ SuppressWarnings ( "unchecked" ) public < T > T fromJson ( JsonReader reader , Type typeOfT ) throws JsonIOException , JsonSyntaxException { boolean isEmpty = true ; boolean oldLenient = reader . isLenient ( ) ; reader . setLenient ( true ) ; try { reader . peek ( ) ; isEmpty = false ; TypeAdapter < T > typeAdapter = ( TypeAdapter < T > ) getAdapter ( TypeToken . get ( typeOfT ) ) ; return typeAdapter . read ( reader ) ; } catch ( EOFException e ) { /*
       * For compatibility with JSON 1.5 and earlier, we return null for empty
       * documents instead of throwing.
       */ if ( isEmpty ) { return null ; } throw new JsonSyntaxException ( e ) ; } catch ( IllegalStateException e ) { throw new JsonSyntaxException ( e ) ; } catch ( IOException e ) { // TODO(inder): Figure out whether it is indeed right to rethrow this as JsonSyntaxException throw new JsonSyntaxException ( e ) ; } finally { reader . setLenient ( oldLenient ) ; } }
Reads the next JSON value from {@code reader} and convert it to an object
of type {@code typeOfT}.
Since Type is not parameterized by T, this method is type unsafe and should be used carefully

@throws JsonIOException if there was a problem writing to the Reader
@throws JsonSyntaxException if json is not a valid representation for an object of type
Reads the next JSON value from { @code reader } and convert it to an object of type { @code typeOfT } . Since Type is not parameterized by T this method is type unsafe and should be used carefully