I know that i can send a ArrayList to a ip using code below.
List list = new ArrayList();
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream outputStream = new ObjectOutputStream(out);
outputStream.writeObject(list);
outputStream.close();
byte[] listData = out.toByteArray();
When I replace list with a HashMap why it do not work? How can I send the HashMap if I can't send it this way?