Socket s = new Socket("192.168.1.100", 10005);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D:\\WIN7.iso"));
BufferedOutputStream bos = new BufferedOutputStream(s.getOutputStream());
long time1 = System.currentTimeMillis();
byte[] buff = new byte[1024*1024*32];
int by = 0;
while((by = bis.read(buff)) != -1){
bos.write(buff, 0, by);
bos.flush();
}
s.shutdownOutput();
long time2 = System.currentTimeMillis();
Socket s = new Socket("192.168.1.100", 10005);
FileInputStream fis = new FileInputStream("D:\\WIN7.iso");
OutputStream out = s.getOutputStream();
long time1 = System.currentTimeMillis();
byte[] buff = new byte[1024*1024*32];
int by = 0;
while((by = fis.read(buff)) != -1){
out.write(buff, 0, by);
out.flush();
}
s.shutdownOutput();
long time2 = System.currentTimeMillis();