code: public byte[] encode(Map<String, String> map) throws SerializationException {
          if (map == null || map.isEmpty()) {
              return null;
          }
          UnsafeByteArrayOutputStream out = new UnsafeByteArrayOutputStream(64);
          try {
              for (Map.Entry<String, String> entry : map.entrySet()) {
                  writeString(out, entry.getKey());
                  writeString(out, entry.getValue());
              }
              return out.toByteArray();
          } catch (IOException ex) {
              throw new SerializationException(ex.getMessage(), ex);
          }
      }
docs: 简单 map 的序列化过程, 用来序列化 bolt 的 header
  
  @param map bolt header
  @return 序列化后的 byte 数组
  @throws SerializationException SerializationException