private final void sendResponse(HttpExchange exc, Response response) throws IOException {
        for (Map.Entry<String, List<String>> entry : response.getParams().entrySet()) {
            for (String value : entry.getValue()) {
                exc.getResponseHeaders().add(entry.getKey(), value);
            }
        }
        byte[] data = null;
        long length = -1;
        if (response.getData() != null) {
            data = SerializationStuff.getBytes(response.getData());
            length = data.length;
        }
        exc.sendResponseHeaders(response.getCode().code, length);
        if (data != null) {
            exc.getResponseBody().write(data);
        }
        Logger.getLogger("").info("send response " + response);

    }