Exemple #1
0
  /**
   * Use <code>readObject</code> method to capture whether or not integrity was being enforced when
   * this object was unmarshalled, and to perform basic integrity checks.
   */
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();
    if (className == null) throw new InvalidObjectException("null className");

    if (values == null) throw new InvalidObjectException("null values");

    if (superclasses == null) throw new InvalidObjectException("null superclasses");

    if (hashes == null) throw new InvalidObjectException("null hashes");

    if (hashes.length != superclasses.length)
      throw new InvalidObjectException(
          "hashes.length ("
              + hashes.length
              + ") does not equal  superclasses.length ("
              + superclasses.length
              + ")");

    // get value for integrity flag
    integrity = MarshalledWrapper.integrityEnforced(in);
  }
 /* Set transient fields. */
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   in.defaultReadObject();
   verifyCodebaseIntegrity = MarshalledWrapper.integrityEnforced(in);
 }