public static void writeStringMap(DataOutput out,@Nullable Map<String,String> map) throws IOException {
  if (map != null) {
    out.writeInt(map.size());
    for (    Map.Entry<String,String> e : map.entrySet()) {
      writeUTFStringNullable(out,e.getKey());
      writeUTFStringNullable(out,e.getValue());
    }
  }
 else   out.writeInt(-1);
}

public static void writeStringMap ( DataOutput out , @ Nullable Map < String , String > map ) throws IOException { if ( map != null ) { out . writeInt ( map . size ( ) ) ; for ( Map . Entry < String , String > e : map . entrySet ( ) ) { writeUTFStringNullable ( out , e . getKey ( ) ) ; writeUTFStringNullable ( out , e . getValue ( ) ) ; } } else out . writeInt ( - 1 ) ; }
writes string - to - string map to given data output .
