code: private void writeObject(ObjectOutputStream stream) throws IOException {
  
          stream.defaultWriteObject();
  
          // not all values in the property bag are going to be serializable; we
          // need to be careful which parts of the bag we serialize
          //
          Map<Object, Object> tempProperties = new HashMap<Object, Object>();
          for (Object key : this.properties.keySet()) {
              Object value = this.properties.get(key);
  
              if (value instanceof Serializable || value instanceof Externalizable) {
  
                  tempProperties.put(key, value);
              } else {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "value for key \"" + key + "\" is not serializable");
                  }
              }
          }
  
          stream.writeObject(tempProperties);
      }
docs: Override the Serializable method.
  
  @param stream
  @throws IOException