From a2dede8448dd9b85d91d972338ede0ce628d5950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E8=89=BA=E5=B3=B0?= <1064168114@qq.com> Date: Thu, 4 Mar 2021 09:28:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DByte[]=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=AD=BB=E5=BE=AA=E7=8E=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/text/Convert.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java index 1c87e75b..aa7c436b 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java @@ -797,7 +797,17 @@ public class Convert } else if (obj instanceof byte[] || obj instanceof Byte[]) { - return str((Byte[]) obj, charset); + if (obj instanceof byte[]){ + return str((byte[]) obj, charset); + } else { + Byte[] bytes = (Byte[])obj; + int length = bytes.length; + byte[] dest = new byte[length]; + for (int i = 0; i < length; i++) { + dest[i] = bytes[i]; + } + return str (dest,charset); + } } else if (obj instanceof ByteBuffer) {