@@ -1,9 +1,9 @@ | |||||
package com.hz.pm.api.common.util; | package com.hz.pm.api.common.util; | ||||
import cn.hutool.core.codec.Base64Decoder; | |||||
import cn.hutool.core.codec.Base64Encoder; | |||||
import cn.hutool.core.util.StrUtil; | import cn.hutool.core.util.StrUtil; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import sun.misc.BASE64Decoder; | |||||
import sun.misc.BASE64Encoder; | |||||
import java.io.ByteArrayInputStream; | import java.io.ByteArrayInputStream; | ||||
import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
@@ -35,7 +35,7 @@ public class GzipUtil { | |||||
gzip.write(content.getBytes()); | gzip.write(content.getBytes()); | ||||
gzip.finish(); | gzip.finish(); | ||||
byte[] bytes = bos.toByteArray(); | byte[] bytes = bos.toByteArray(); | ||||
return new BASE64Encoder().encode(bytes); | |||||
return Base64Encoder.encode(bytes); | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BizException(e); | throw new BizException(e); | ||||
} | } | ||||
@@ -48,8 +48,7 @@ public class GzipUtil { | |||||
if (StrUtil.isBlank(content)) { | if (StrUtil.isBlank(content)) { | ||||
return content; | return content; | ||||
} | } | ||||
BASE64Decoder decoder = new BASE64Decoder(); | |||||
try (ByteArrayInputStream bis = new ByteArrayInputStream(decoder.decodeBuffer(content)); | |||||
try (ByteArrayInputStream bis = new ByteArrayInputStream(Base64Decoder.decode(content)); | |||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(); | ByteArrayOutputStream bos = new ByteArrayOutputStream(); | ||||
GZIPInputStream gis = new GZIPInputStream(bis)) { | GZIPInputStream gis = new GZIPInputStream(bis)) { | ||||
byte[] buffer = new byte[1024 * 16]; | byte[] buffer = new byte[1024 * 16]; | ||||
@@ -1,5 +1,6 @@ | |||||
package com.hz.pm.api.irs.sign; | package com.hz.pm.api.irs.sign; | ||||
import cn.hutool.core.codec.Base64Decoder; | |||||
import cn.hutool.core.io.FileUtil; | import cn.hutool.core.io.FileUtil; | ||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
@@ -18,7 +19,6 @@ import org.apache.http.entity.ByteArrayEntity; | |||||
import org.apache.http.entity.ContentType; | import org.apache.http.entity.ContentType; | ||||
import org.apache.http.impl.client.CloseableHttpClient; | import org.apache.http.impl.client.CloseableHttpClient; | ||||
import org.apache.http.impl.client.HttpClients; | import org.apache.http.impl.client.HttpClients; | ||||
import sun.misc.BASE64Decoder; | |||||
import javax.crypto.Mac; | import javax.crypto.Mac; | ||||
import javax.crypto.spec.SecretKeySpec; | import javax.crypto.spec.SecretKeySpec; | ||||
@@ -242,8 +242,7 @@ public class IRSAPIRequest { | |||||
* @param base64Content 文件的存储路径(含文件名) | * @param base64Content 文件的存储路径(含文件名) | ||||
*/ | */ | ||||
public static void base64StringToPdf(String base64Content, String filePath) throws IOException { | public static void base64StringToPdf(String base64Content, String filePath) throws IOException { | ||||
BASE64Decoder decoder = new BASE64Decoder(); | |||||
byte[] bytes = decoder.decodeBuffer(base64Content); | |||||
byte[] bytes = Base64Decoder.decode(base64Content); | |||||
File file = new File(filePath); | File file = new File(filePath); | ||||
FileUtil.mkParentDirs(file); | FileUtil.mkParentDirs(file); | ||||
try (ByteArrayInputStream byteInputStream = new ByteArrayInputStream(bytes); | try (ByteArrayInputStream byteInputStream = new ByteArrayInputStream(bytes); | ||||
@@ -3,6 +3,7 @@ package com.hz.pm.api.todocenter.manage; | |||||
import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||
import cn.hutool.core.bean.copier.CopyOptions; | import cn.hutool.core.bean.copier.CopyOptions; | ||||
import cn.hutool.core.codec.Base64; | import cn.hutool.core.codec.Base64; | ||||
import cn.hutool.core.codec.Base64Decoder; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.map.MapUtil; | import cn.hutool.core.map.MapUtil; | ||||
import cn.hutool.core.util.ObjectUtil; | import cn.hutool.core.util.ObjectUtil; | ||||
@@ -102,7 +103,6 @@ import org.springframework.mock.web.MockMultipartFile; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
import sun.misc.BASE64Decoder; | |||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import java.io.ByteArrayInputStream; | import java.io.ByteArrayInputStream; | ||||
@@ -487,10 +487,9 @@ public class TodoCenterManage { | |||||
String signPdf = IRSAPIRequest.createSignPdf(signReq); | String signPdf = IRSAPIRequest.createSignPdf(signReq); | ||||
ByteArrayInputStream inputStream = null; | ByteArrayInputStream inputStream = null; | ||||
if (Objects.nonNull(signPdf)) { | if (Objects.nonNull(signPdf)) { | ||||
BASE64Decoder decoder = new BASE64Decoder(); | |||||
try { | try { | ||||
//转码 | //转码 | ||||
byte[] b = decoder.decodeBuffer(signPdf); | |||||
byte[] b = Base64Decoder.decode(signPdf); | |||||
for (int i = 0; i < b.length; ++i) { | for (int i = 0; i < b.length; ++i) { | ||||
if (b[i] < 0) {//调整异常数据 | if (b[i] < 0) {//调整异常数据 | ||||
b[i] += 256; | b[i] += 256; | ||||