code: protected final void writeMapTo( Map<String,Object> map , RawDataBuffer out )
      {
      	if (map == null)
      	{
      		out.writeInt(0);
      		return;
      	}
      	
          out.writeInt(map.size());
          if (!map.isEmpty())
          {
              Iterator<Map.Entry<String,Object>> allEntries = map.entrySet().iterator();
              while (allEntries.hasNext())
              {
                  Map.Entry<String,Object> entry = allEntries.next();
                  out.writeUTF(entry.getKey());
                  out.writeGeneric(entry.getValue());
              }
          }
      }
docs: Write a map to the given output stream