code: public static <T> Class<T> resolveClassByName(
  			DataInputView in,
  			ClassLoader cl,
  			Class<? super T> supertype) throws IOException {
  
  		final String className = in.readUTF();
  		final Class<?> rawClazz;
  		try {
  			rawClazz = Class.forName(className, false, cl);
  		}
  		catch (ClassNotFoundException e) {
  			throw new IOException(
  					"Could not find class '" + className +  "' in classpath.", e);
  		}
  
  		if (!supertype.isAssignableFrom(rawClazz)) {
  			throw new IOException("The class " + className + " is not a subclass of " + supertype.getName());
  		}
  
  		@SuppressWarnings("unchecked")
  		Class<T> clazz = (Class<T>) rawClazz;
  		return clazz;
  	}
docs: Loads a class by name from the given input stream and reflectively instantiates it.
  
  <p>This method will use {@link DataInputView#readUTF()} to read the class name, and
  then attempt to load the class from the given ClassLoader.
  
  <p>The resolved class is checked to be equal to or a subtype of the given supertype
  class.
  
  @param in The stream to read the class name from.
  @param cl The class loader to resolve the class.
  @param supertype A class that the resolved class must extend.
  
  @throws IOException Thrown, if the class name could not be read, the class could not be found,
  or the class is not a subtype of the given supertype class.