Have you looked at the user guide for GSON? I suspect you want something along the lines of
Gson gson = new Gson();
String json = gson.toJson(mapResponse);
To write data back to the socket look at Reading from and Writing to a Socket. This might work:
new PrintWriter(responseToClient, true).println(json);