code: public static ObjectInputStream newObjectInputStream(InputStream inputStream, final ClassLoader classLoader) throws IOException {
          return new ObjectInputStream(inputStream) {
              protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
                  return Class.forName(desc.getName(), true, classLoader);
  
              }
          };
      }
docs: Create an object input stream for this input stream using the given class loader.
  
  @param inputStream an input stream
  @param classLoader the class loader to use when loading the class
  @return an object input stream
  @throws IOException if an IOException occurs.
  @since 1.5.0