﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-晓俊</title><link>http://www.blogjava.net/jxj80922/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 07 May 2026 02:26:40 GMT</lastBuildDate><pubDate>Thu, 07 May 2026 02:26:40 GMT</pubDate><ttl>60</ttl><item><title>java.io</title><link>http://www.blogjava.net/jxj80922/archive/2006/06/20/53962.html</link><dc:creator>JavaDoIt</dc:creator><author>JavaDoIt</author><pubDate>Tue, 20 Jun 2006 05:15:00 GMT</pubDate><guid>http://www.blogjava.net/jxj80922/archive/2006/06/20/53962.html</guid><wfw:comment>http://www.blogjava.net/jxj80922/comments/53962.html</wfw:comment><comments>http://www.blogjava.net/jxj80922/archive/2006/06/20/53962.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/jxj80922/comments/commentRss/53962.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jxj80922/services/trackbacks/53962.html</trackback:ping><description><![CDATA[	
public static void Url() throws MalformedURLException{
		File file = new File("b.txt");
		
		URL url =null;
		url = file.toURL();
		String dir =file.getPath();
		System.out.print(file.getAbsolutePath());
		file.renameTo(new File(dir,file.getName()));

	}
	
	
public static void cope()throws IOException{
		File file = new File("b.txt");
		File file2 = new File("c.txt");
		if(!file2.exists()){
			file2.createNewFile();
		}
		FileInputStream in = new FileInputStream(file);
//		InputStream in = url.openStream();
		FileOutputStream out = new FileOutputStream(file2);
		byte[] buffer = new byte[4096];
		int data;
		while((data = in.read(buffer))!=-1){
			out.write(buffer,0,data);
		}
		in.close();
		out.close();
	}
	
	
public static void read() throws IOException{
		File file = new File("b.txt");
	    System.out.print("Overwrite existing file " + file.getName() +"? (Y/N): ");
	    System.out.flush();
	    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String readtowrite = in.readLine();
        
		BufferedWriter  ot = new BufferedWriter(new FileWriter("b.txt"));
		ot.write(readtowrite);
		ot.close();

	}
	
	
public static void test() throws IOException{
		File file = new File("b.txt");
		if(!file.exists()){
			file.createNewFile();			
		}
		File file2 = new File("c.txt");
		if(!file2.exists()){
			file2.createNewFile();
		}
		FileInputStream in = new FileInputStream(file);
//		InputStream in = url.openStream();
		FileOutputStream out = new FileOutputStream(file2);
		byte[] buffer = new byte[4096];
		int data;
		while((data = in.read(buffer))!=-1){
			out.write(buffer,0,data);
		}
		in.close();
		out.close();
		
	}
	
public static void compress() throws IOException{
		File file = new File("b.txt");
		FileInputStream in = new FileInputStream(file);
		String to =file.getName()+".zip";
		GZIPOutputStream out = new GZIPOutputStream(new FileOutputStream("e:/"+to));
		byte[] buffer = new byte[4096];
		int data;
		while((data = in.read(buffer))!=-1){
			out.write(buffer,0,data);
		}
		in.close();
		out.close();
		
	}
<img src ="http://www.blogjava.net/jxj80922/aggbug/53962.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jxj80922/" target="_blank">JavaDoIt</a> 2006-06-20 13:15 <a href="http://www.blogjava.net/jxj80922/archive/2006/06/20/53962.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>