code: private void writeObject(final ObjectOutputStream out) throws IOException {
          out.defaultWriteObject();
          out.writeInt(table.length);
  
          // Have to use null-terminated list because size might shrink
          // during iteration
  
          for (final Object o : entrySet()) {
              final Map.Entry entry = (Map.Entry) o;
              out.writeObject(entry.getKey());
              out.writeObject(entry.getValue());
          }
          out.writeObject(null);
      }
docs: Writes this object to the given output stream.
  
  @param out the output stream to write to
  @throws IOException if the stream raises it