Writing 'data' as OOS#writeObject() might result in more bytes size getting transferred from server to client. What we need is the keys and values right? Can you write a custom logic?
Write the size of the Map
Write the length of the 1st key
Write the 1st key
Write length of the 1st value
Write 1st value
..... (for all the key values)