-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.java
More file actions
76 lines (71 loc) · 1.89 KB
/
server.java
File metadata and controls
76 lines (71 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package webproject.net.study;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class server {
public static void main(String[] args) {
// decrypt("F:/项目/APIインターフェイス仕様書(統合ID管理)_v1.83.zip","F:/项目/test.zip");
joinPro(new File("F:/项目/test2"),new File("F:/项目/APIインターフェイス仕様書(統合ID管理)_v1.80.xlsx"),new File("F:/项目/APIインターフェイス仕様書(統合ID管理)_v1.81.xlsx"));
System.out.println("成功");
}
public static void decrypt(String src, String dest) {
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(src);
fos = new FileOutputStream(dest);
int len = -1;
while ((len = fis.read())!=-1){
fos.write(len^0xff);
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try{
if(fis != null){
fis.close();
}
if(fos!= null){
fos.close();
}
}
catch (Exception e) {
e.printStackTrace();
}
}
}
public static void joinPro(File destFile,File... files){
int len = files.length;
FileOutputStream fos = null;
try {
fos = new FileOutputStream(destFile);
for(int i = 0 ;i < len ;i ++){
FileInputStream fis = new FileInputStream(files[i]);
int len1 = -1;
while ((len1 = fis.read())!= -1){
fos.write(len1^0xff);
}
fis.close();
}
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally{
try {
if(fos!=null){
fos.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}