code: public static <T> T validate(InputStream input, final Class<T> clazz) throws IOException {
          return JSON.parseObject(input, clazz);
      }
docs: Validates an input and returns an instance of a given class constructed from the input.
  
  @param input the input to be validated
  @param clazz the class to be used to create an instance from the input
  @return an instance created from the input
  @throws IOException ioException