Exemplo n.º 1
0
  private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    Object[] tValues;

    s.defaultReadObject();

    tValues = (Object[]) s.readObject();

    if (tValues.length > 0 && tValues[0].equals("userObject")) userObject = tValues[1];
  }
Exemplo n.º 2
0
  /**
   * Reads the <code>ObjectInputStream</code> and if it isn't <code>null</code> adds a listener to
   * receive item events fired by the <code>Checkbox</code>. Unrecognized keys or values will be
   * ignored.
   *
   * @param s the <code>ObjectInputStream</code> to read
   * @exception HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true
   *     </code>
   * @serial
   * @see #removeItemListener(ItemListener)
   * @see #addItemListener(ItemListener)
   * @see j86.java.awt.GraphicsEnvironment#isHeadless
   * @see #writeObject(ObjectOutputStream)
   */
  private void readObject(ObjectInputStream s)
      throws ClassNotFoundException, IOException, HeadlessException {
    GraphicsEnvironment.checkHeadless();
    s.defaultReadObject();

    Object keyOrNull;
    while (null != (keyOrNull = s.readObject())) {
      String key = ((String) keyOrNull).intern();

      if (itemListenerK == key) addItemListener((ItemListener) (s.readObject()));
      else // skip value for unrecognized key
      s.readObject();
    }
  }
Exemplo n.º 3
0
  /*
   * readObject is called to restore the state of the random object from
   * a stream.  We have to create a new instance of MessageDigest, because
   * it is not included in the stream (it is marked "transient").
   *
   * Note that the engineNextBytes() method invoked on the restored random
   * object will yield the exact same (random) bytes as the original.
   * If you do not want this behaviour, you should re-seed the restored
   * random object, using engineSetSeed().
   */
  private void readObject(j86.java.io.ObjectInputStream s)
      throws IOException, ClassNotFoundException {

    s.defaultReadObject();

    try {
      digest = MessageDigest.getInstance("SHA");
    } catch (NoSuchAlgorithmException e) {
      throw new InternalError("internal error: SHA-1 not available.", e);
    }
  }
Exemplo n.º 4
0
  /**
   * readObject is called to restore the state of the {@code BatchUpdateException} from a stream.
   */
  private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {

    ObjectInputStream.GetField fields = s.readFields();
    int[] tmp = (int[]) fields.get("updateCounts", null);
    long[] tmp2 = (long[]) fields.get("longUpdateCounts", null);
    if (tmp != null && tmp2 != null && tmp.length != tmp2.length)
      throw new InvalidObjectException("update counts are not the expected size");
    if (tmp != null) updateCounts = tmp.clone();
    if (tmp2 != null) longUpdateCounts = tmp2.clone();
    if (updateCounts == null && longUpdateCounts != null)
      updateCounts = copyUpdateCount(longUpdateCounts);
    if (longUpdateCounts == null && updateCounts != null)
      longUpdateCounts = copyUpdateCount(updateCounts);
  }