Map.Entry me = (Map.Entry)it.next(); out.writeUTF((String)me.getKey()); Object value = me.getValue(); if (value == null)
out.writeByte(NULL); } else { out.writeByte(MAP); Set entrySet = map.entrySet(); out.writeInt(entrySet.size()); for (Iterator it = entrySet.iterator(); it.hasNext(); )
   protected void writeMap(ObjectOutput out, Map map) throws IOException   {      Set entrySet = map.entrySet();      out.writeInt(entrySet.size());      for (Iterator it = entrySet.iterator(); it.hasNext(); )      {         Map.Entry me = (Map.Entry)it.next();         out.writeUTF((String)me.getKey());         Object value = me.getValue();         if (value == null)         {            out.writeByte(OBJECT);            out.writeObject(value);         }         else if (value instanceof String)         {            out.writeByte(STRING);            out.writeUTF((String) value);         }         else if (value instanceof Integer)         {            out.writeByte(INT);            out.writeInt(((Integer) value).intValue());         }         else if (value instanceof Boolean)         {            out.writeByte(BOOLEAN);            out.writeBoolean(((Boolean) value).booleanValue());         }         else if (value instanceof Byte)         {            out.writeByte(BYTE);            out.writeByte(((Byte) value).byteValue());         }         else if (value instanceof Short)         {            out.writeByte(SHORT);            out.writeShort(((Short) value).shortValue());         }         else if (value instanceof Long)         {            out.writeByte(LONG);            out.writeLong(((Long) value).longValue());         }         else if (value instanceof Float)         {            out.writeByte(FLOAT);            out.writeFloat(((Float) value).floatValue());         }         else if (value instanceof Double)         {            out.writeByte(DOUBLE);            out.writeDouble(((Double) value).doubleValue());         }         else         {            out.writeByte(OBJECT);            out.writeObject(value);         }      }   }