void saveEntities(DataOutputStream out) throws IOException {
  int num=0;
  for (Enumeration<Entity> e=entityHash.elements(); e.hasMoreElements(); ) {
    Entity ent=e.nextElement();
    if (ent.isGeneral()) {
      num++;
    }
  }
  out.writeShort((short)num);
  for (Enumeration<Entity> e=entityHash.elements(); e.hasMoreElements(); ) {
    Entity ent=e.nextElement();
    if (ent.isGeneral()) {
      out.writeShort(getNameId(ent.getName()));
      out.writeByte(ent.getType() & ~GENERAL);
      out.writeUTF(ent.getString());
    }
  }
}

void saveEntities ( DataOutputStream out ) throws IOException { int num = 0 ; for ( Enumeration < Entity > e = entityHash . elements ( ) ; e . hasMoreElements ( ) ; ) { Entity ent = e . nextElement ( ) ; if ( ent . isGeneral ( ) ) { num ++ ; } } out . writeShort ( ( short ) num ) ; for ( Enumeration < Entity > e = entityHash . elements ( ) ; e . hasMoreElements ( ) ; ) { Entity ent = e . nextElement ( ) ; if ( ent . isGeneral ( ) ) { out . writeShort ( getNameId ( ent . getName ( ) ) ) ; out . writeByte ( ent . getType ( ) & ~ GENERAL ) ; out . writeUTF ( ent . getString ( ) ) ; } } }
save an entity to a stream .
