InputStream is = socket.getInputStream();BufferedReader in = new BufferedReader(new InputStreamReader(is));StringBuffer input;while (true){ input2 = new StringBuffer(); while (is.available() > 0) { input2.append((char) in.read()); } //mach etwas mit input2}