InputStream in = s.getInputStream();
byte[] bufIn = new byte[1024];
int num = in.read(bufIn);
System.out.println(new String(bufIn,0,num));
fis.close();
s.close();
}
}
public class PicServer {
public static void main(String[] args) throws Exception {
ServerSocket ss = new ServerSocket(10001);
while(true){
Socket s = ss.accept();
new Thread(new ServerThread(s)).start();
}
//ss.close();
}
}
public class ServerThread implements Runnable{
private Socket s ;
ServerThread(Socket s){
this.s = s;
}
@Override
public void run() {
// TODO Auto-generated method stub
try {
FileOutputStream os = new FileOutputStream("1.jpg");
InputStream in = s.getInputStream();