我的源代码:
InputStream is = ms.getInputStream();
OutputStream s = new FileOutputStream("d:/temp/demo.html");
byte b[] = new byte[1024];
while (is.read(b) != -1) {
os.write(b);
os.flush();
}
is.close();
os.close();
就这样读出来的内容最后会多出来一点,就是最后一点内容读了两次!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24006215/viewspace-675570/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24006215/viewspace-675570/