package com.heima.practice;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class Practice6 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("copy.png"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("copy1.png"));
int a ;
while ((a = bis.read())!= -1) {
bos.write(a^123);
}
bis.close();
bos.close();
}
}
同样的也可以用这个方法对视频进行加密!
|
|