Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
tool
/
xxl-job
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f7319415
authored
Dec 08, 2023
by
oddityyyy
Committed by
GitHub
Dec 08, 2023
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update JdkSerializeTool.java
优化了关闭流的操作
1 parent
72963e47
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
xxl-job-core/src/main/java/com/xxl/job/core/util/JdkSerializeTool.java
xxl-job-core/src/main/java/com/xxl/job/core/util/JdkSerializeTool.java
View file @
f731941
...
@@ -51,16 +51,18 @@ public class JdkSerializeTool {
...
@@ -51,16 +51,18 @@ public class JdkSerializeTool {
* @return
* @return
*/
*/
public
static
<
T
>
Object
deserialize
(
byte
[]
bytes
,
Class
<
T
>
clazz
)
{
public
static
<
T
>
Object
deserialize
(
byte
[]
bytes
,
Class
<
T
>
clazz
)
{
ObjectInputStream
ois
=
null
;
ByteArrayInputStream
bais
=
null
;
ByteArrayInputStream
bais
=
null
;
try
{
try
{
// 反序列化
// 反序列化
bais
=
new
ByteArrayInputStream
(
bytes
);
bais
=
new
ByteArrayInputStream
(
bytes
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
bais
);
ois
=
new
ObjectInputStream
(
bais
);
return
ois
.
readObject
();
return
ois
.
readObject
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
finally
{
try
{
try
{
ois
.
close
();
bais
.
close
();
bais
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment