This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
This is the serversocket code for read and write binary data from applet. DataOutputStream out =new DataOutputStream(socket.getOutputStream()); BufferedReader br= new BufferedReader(new InputStreamReader(socket.getInputStream())); String ss=br.readLine(); br.close(); String FileName="data/"+ss+".dat"; DataInputStream datainputstream = new DataInputStream(new FileInputStream(FileName)); datainputstream.skipBytes(10); datainputstream.read(points,0,126); datainputstream.close(); out.write(points,0,126); out.println(T); out.close(); // this is for connection to Serversocket and get the binary data from serversocket Socket socket=new Socket("192.168.0.71",port); PrintStream out= new PrintStream(socket.getOutputStream()); out.println(filename); out.flush(); out.close(); byte p01=new byte; DataInputStream in=new DataInputStream(socket.getInputStream()); in.read(p01,0,300); in.close(); socket.close(); ServerSocket can read request from applet, but cannot send binary data to applet. Maybe some mistakes in my code, please check them. If you have examples related with my situation send to me. Sincerely