2 Star 0 Fork 0

20175334罗昕锐 / java2017

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
MyCP.java 909 Bytes
一键复制 编辑 原始数据 按行查看 历史
20175334罗昕锐 提交于 2019-04-28 21:51 . 课本代码
import java.io.*;
public class MyCP {
public static void main(String []args) throws IOException {
FileInputStream in = new FileInputStream(args[1]);
FileOutputStream out = new FileOutputStream(args[2]);
String str = new String(args[0]);
byte[] data = new byte[1024];
int length;
if(str.equals("-tx")) {
while((length = in.read(data)) != -1) {
int n = data.hashCode();
String binaryNum = Integer.toBinaryString(n);
data = binaryNum.getBytes();
out.write(data);
}
}
else if(str.equals("-xt")) {
while((length = in.read(data)) != -1) {
int n = data.hashCode();
String binaryNum = Integer.toString(n);
data = binaryNum.getBytes();
out.write(data);
}
}
}
}
Java
1
https://gitee.com/lxr175334/java2017.git
git@gitee.com:lxr175334/java2017.git
lxr175334
java2017
java2017
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891