BinarySerializer serializer = new BinarySerializer();
response.setContentType(serializer.getMIMEType(map));
try {
serializer.writeObject(map, response.getOutputStream());
} catch(SerializationException exception) {
throw new ServletException(exception);
}
}