★★ Java の宿題ここで答えます Part 61 ★★at TECH
★★ Java の宿題ここで答えます Part 61 ★★ - 暇つぶし2ch434:デフォルトの名無しさん
07/06/20 18:43:57
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;

public class getURL{
public static void main(String[] args){
try{
for(int i = 892; i <= 905; i++){
byte[] buf = new byte[8192];
String outfile = Integer.toString(i) + ".jpg";
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(outfile, false)
);
URL url = new URL("URLリンク(cap.in.coocan.jp) + Integer.toString(i) + ".jpg");
InputStream is = url.openStream();
for(int rs; (rs = is.read(buf)) != -1; ){
bos.write(buf, 0, rs);
}
is.close();
bos.close();
}
}catch(Exception e){
e.printStackTrace();
}
}
}



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch