docs: public static void serialize(Serializable obj, OutputStream outputStream) {
          if (outputStream == null) {
              throw new IllegalArgumentException("The OutputStream must not be null");
          }
          ObjectOutputStream out = null;
          try {
              // stream closed in the finally
              out = new ObjectOutputStream(outputStream);
              out.writeObject(obj);
  
          } catch (IOException ex) {
              throw new SerializationException(ex);
          } finally {
              try {
                  if (out != null) {
                      out.close();
                  }
              } catch (IOException ex) {
                  // ignore close exception
              }
          }
      }