FileOutputStream fos = new FileOutputSteam( "d://new.html ");
URL url = new URL( "http://bbs.youkuaiyun.com/ ");
UrlConnection uc = url.openConnection();
uc.connect();
uc.setDoInput(true);
uc.setDoOutput(false);
InputStream is = new InputStream(uc.getInputStream());
byte[] buffer = new byte[2048];
int length=0;
while((length = is.read(buffer))!=-1)
{ fos.write(buffer,0,length); }
is.close();
fos.close();
URL url = new URL( "http://bbs.youkuaiyun.com/ ");
UrlConnection uc = url.openConnection();
uc.connect();
uc.setDoInput(true);
uc.setDoOutput(false);
InputStream is = new InputStream(uc.getInputStream());
byte[] buffer = new byte[2048];
int length=0;
while((length = is.read(buffer))!=-1)
{ fos.write(buffer,0,length); }
is.close();
fos.close();