How to create a HTTP-response sending an image in JAVA?
问题 I'm occurring some trouble writing a basic webserver in JAVA. It's currently working fine at delivering html or css files. But when it comes to images things are messed up. I assume I'm doing something wrong at reading the image-files and preparing them to be sent. But have a look at the code: public void launch() { while(true) { try { Socket connection = this.server_socket.accept(); ... PrintWriter print_writer = new PrintWriter(connection.getOutputStream()); String response = this.readFile