import java.io.FileInputStream;
import java.io.FileOutputStream;
InputStream is = new FileInputStream("abc.txt");
OutputStream os = new FileOutputStream("def.txt");
int n = 0,total=0;
byte[] ba = new byte[1024];
while ((n = is.read(ba)) != -1){
os.write(ba, 0, n);
total+=n;
}
System.out.println("共有" + total + "位元組");
沒有留言:
張貼留言