private void writeObject(ObjectOutputStream s) throws IOException {
  s.defaultWriteObject();
  Attribute[] attrs=toArray();
  s.writeInt(attrs.length);
  for (int i=0; i < attrs.length; i++) {
    s.writeObject(attrs[i]);
  }
}

private void writeObject ( ObjectOutputStream s ) throws IOException { s . defaultWriteObject ( ) ; Attribute [ ] attrs = toArray ( ) ; s . writeInt ( attrs . length ) ; for ( int i = 0 ; i < attrs . length ; i ++ ) { s . writeObject ( attrs [ i ] ) ; } }
write the instance to a stream ( ie serialize the object )
