Browse Source

!49 修复Byte[]类型参数死循环的问题

Merge pull request !49 from 周艺峰/master
tags/v3.0.0
若依 4 years ago committed by Gitee
parent
commit
2b7bb59d12
  1. 12
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java

12
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/text/Convert.java

@ -797,7 +797,17 @@ public class Convert @@ -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)
{

Loading…
Cancel
Save