code: public static Object decodeToObject (@Nonnull final String encodedObject,
                                         final int options,
                                         @Nullable final ClassLoader loader) throws IOException, ClassNotFoundException
    {
      // Decode and gunzip if necessary
      final byte [] objBytes = decode (encodedObject, options);
  
      ObjectInputStream ois = null;
      Object obj = null;
  
      try (final NonBlockingByteArrayInputStream bais = new NonBlockingByteArrayInputStream (objBytes))
      {
        // If no custom class loader is provided, use Java's builtin OIS.
        if (loader == null)
        {
          ois = new ObjectInputStream (bais);
        }
        else
        {
          // Else make a customized object input stream that uses
          // the provided class loader.
          ois = new ObjectInputStream (bais)
          {
            @Override
            public Class <?> resolveClass (final ObjectStreamClass streamClass) throws IOException, ClassNotFoundException
            {
              final Class <?> c = Class.forName (streamClass.getName (), false, loader);
              if (c != null)
                return c;
              return super.resolveClass (streamClass);
            }
          };
        }
  
        obj = ois.readObject ();
      }
      finally
      {
        StreamHelper.close (ois);
      }
  
      return obj;
    }
docs: Attempts to decode Base64 data and deserialize a Java Object within.
  Returns <code>null</code> if there was an error. If <code>loader</code> is
  not null, it will be the class loader used when deserializing.
  
  @param encodedObject
  The Base64 data to decode
  @param options
  Various parameters related to decoding
  @param loader
  Optional class loader to use in deserializing classes.
  @return The decoded and deserialized object
  @throws NullPointerException
  if encodedObject is null
  @throws IOException
  if there is a general error
  @throws ClassNotFoundException
  if the decoded object is of a class that cannot be found by the JVM
  @since 2.3.4