code: public MessagePacker packMapHeader(int mapSize)
              throws IOException
      {
          if (mapSize < 0) {
              throw new IllegalArgumentException("map size must be >= 0");
          }
  
          if (mapSize < (1 << 4)) {
              writeByte((byte) (FIXMAP_PREFIX | mapSize));
          }
          else if (mapSize < (1 << 16)) {
              writeByteAndShort(MAP16, (short) mapSize);
          }
          else {
              writeByteAndInt(MAP32, mapSize);
          }
          return this;
      }
docs: Writes header of a Map value.
  <p>
  After this method call, for each key-value pair, you will call packer methods for key first, and then value.
  You will call packer methods twice as many time as the size of the map.
  <p>
  You don't have to call anything at the end of iteration.
  
  @param mapSize number of pairs to be written
  @return this
  @throws IOException when underlying output throws IOException