Perhaps I'm missing something, but can't we just create a StreamSerializer for HashMap? This way we can intercept all hashmap serializations.