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]; }
/* * 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); } }
/** * 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(); } }