public static < UK , UV > Map < UK , UV > deserializeMap ( byte [ ] serializedValue , TypeSerializer < UK > keySerializer , TypeSerializer < UV > valueSerializer ) throws IOException { if ( serializedValue != null ) { DataInputDeserializer in = new DataInputDeserializer ( serializedValue , 0 , serializedValue . length ) ; Map < UK , UV > result = new HashMap <> ( ) ; while ( in . available ( ) > 0 ) { UK key = keySerializer . deserialize ( in ) ; boolean isNull = in . readBoolean ( ) ; UV value = isNull ? null : valueSerializer . deserialize ( in ) ; result . put ( key , value ) ; } return result ; } else { return null ; } }
Deserializes all kv pairs with the given serializer .