Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.net.*;
- public class Renshu11_1 {
- public static void main(String[] args) throws Exception {
- URL url = new URL("http://dokojava.jp/favicon.ico");
- InputStream is = url.openStream();
- OutputStream os = new FileOutputStream("dj4.ico");
- int data = is.read();
- while(data != -1) {
- os.write((byte) data);
- data = is.read();
- }
- is.close();
- os.flush();
- os.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement