对接支付开发

This commit is contained in:
hejinbo
2023-09-09 16:50:34 +08:00
parent 362d433bb3
commit 4d2d8b0976
47 changed files with 2503 additions and 2 deletions
@@ -0,0 +1,37 @@
package com.ruoyi.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* 文件读取类
*/
public class FileUtil {
/**
* 获取文件内容
* @param fileName
* @return
*/
public static String readToStr(String fileName){
InputStream is = FileUtil.class.getClassLoader().getResourceAsStream(fileName);
ByteArrayOutputStream os = new ByteArrayOutputStream(2048);
byte[] buffer = new byte[1024];
String str;
try {
int length;
while((length = is.read(buffer)) != -1) {
os.write(buffer, 0, length);
}
str = os.toString("UTF-8");
} catch (IOException var5) {
throw new IllegalArgumentException("无效的密钥", var5);
}
return str;
}
}