日期:2014-05-20 浏览次数:20904 次
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class Test { public static void main(String[] args) throws IOException { FileInputStream aa = new FileInputStream ("D:\\1.txt"); FileOutputStream bb = new FileOutputStream ("D:\\2.txt"); BufferedInputStream mm = new BufferedInputStream (aa); BufferedOutputStream nn = new BufferedOutputStream( bb); byte [] cc = new byte [1024]; int len = mm.read (cc); if (-1 != len) { nn.write (cc); } nn.close(); mm.close (); } }