I have a socket server and Im sending information from client to server and back.
Sock servers will only send strings or byte arrays of information.
The information I need to transfer is java hashmap, but to send it, I convert it to a string.
activeUsers = new HashMap<Object, Object>();
socket.send(activeUsers.toString());
upon receiving this this string, I need to reconstruct it as a hashmap.
I have seen examples like this, however, I think this would not work for my case.
For instance:
an item in the hashmap
can be while the next item is <string, hashmap>
and the items in that hashmap
could be a combinations of the two.
I'm used to python where I can say evaluate string as dictionary and it does so.
How can I achieve the same thing in java.