Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
4ad00364
Commit
4ad00364
authored
Mar 07, 2021
by
若依
Committed by
Gitee
Mar 07, 2021
Browse files
Options
Browse Files
Download
Plain Diff
!182 解决 Byte[] 类型 to string 死循环的问题
Merge pull request !182 from sproutcat/master
parents
616f5a6a
9a384a2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
58 deletions
+55
-58
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
...mon/src/main/java/com/ruoyi/common/core/text/Convert.java
+55
-58
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
View file @
4ad00364
...
...
@@ -7,6 +7,7 @@ import java.nio.charset.Charset;
import
java.text.NumberFormat
;
import
java.util.Set
;
import
com.ruoyi.common.utils.StringUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
/**
* 类型转换器
...
...
@@ -784,23 +785,19 @@ public class Convert
* @param charset 字符集
* @return 字符串
*/
public
static
String
str
(
Object
obj
,
Charset
charset
)
{
if
(
null
==
obj
)
{
public
static
String
str
(
Object
obj
,
Charset
charset
)
{
if
(
null
==
obj
)
{
return
null
;
}
if
(
obj
instanceof
String
)
{
if
(
obj
instanceof
String
)
{
return
(
String
)
obj
;
}
else
if
(
obj
instanceof
byte
[]
||
obj
instanceof
Byte
[])
{
return
str
((
Byte
[])
obj
,
charset
);
}
else
if
(
obj
instanceof
ByteBuffer
)
{
}
else
if
(
obj
instanceof
byte
[])
{
return
str
((
byte
[])
obj
,
charset
);
}
else
if
(
obj
instanceof
Byte
[])
{
byte
[]
bytes
=
ArrayUtils
.
toPrimitive
((
Byte
[])
obj
);
return
str
(
bytes
,
charset
);
}
else
if
(
obj
instanceof
ByteBuffer
)
{
return
str
((
ByteBuffer
)
obj
,
charset
);
}
return
obj
.
toString
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment