Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
47e2af43
Commit
47e2af43
authored
Jun 19, 2016
by
jiangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimization ClusterExternalizableUtil writeByteArray performance
parent
d643c5f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
ClusterExternalizableUtil.java
...openfire/plugin/util/cache/ClusterExternalizableUtil.java
+11
-1
No files found.
src/plugins/hazelcast/src/java/org/jivesoftware/openfire/plugin/util/cache/ClusterExternalizableUtil.java
View file @
47e2af43
...
@@ -373,8 +373,14 @@ public class ClusterExternalizableUtil implements ExternalizableUtilStrategy {
...
@@ -373,8 +373,14 @@ public class ClusterExternalizableUtil implements ExternalizableUtilStrategy {
}
else
if
(
obj
instanceof
Date
)
{
}
else
if
(
obj
instanceof
Date
)
{
out
.
writeByte
(
8
);
out
.
writeByte
(
8
);
out
.
writeLong
(((
Date
)
obj
).
getTime
());
out
.
writeLong
(((
Date
)
obj
).
getTime
());
}
else
{
}
else
if
(
obj
instanceof
byte
[])
{
out
.
writeByte
(
9
);
out
.
writeByte
(
9
);
// write length
out
.
writeInt
(((
byte
[])
obj
).
length
);
// write byte array
out
.
write
((
byte
[])
obj
);
}
else
{
out
.
writeByte
(
10
);
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
bos
);
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
bos
);
oos
.
writeObject
(
obj
);
oos
.
writeObject
(
obj
);
...
@@ -404,6 +410,10 @@ public class ClusterExternalizableUtil implements ExternalizableUtilStrategy {
...
@@ -404,6 +410,10 @@ public class ClusterExternalizableUtil implements ExternalizableUtilStrategy {
}
else
if
(
type
==
8
)
{
}
else
if
(
type
==
8
)
{
return
new
Date
(
in
.
readLong
());
return
new
Date
(
in
.
readLong
());
}
else
if
(
type
==
9
)
{
}
else
if
(
type
==
9
)
{
byte
[]
buf
=
new
byte
[
in
.
readInt
()];
in
.
readFully
(
buf
);
return
buf
;
}
else
if
(
type
==
10
)
{
int
len
=
in
.
readInt
();
int
len
=
in
.
readInt
();
byte
[]
buf
=
new
byte
[
len
];
byte
[]
buf
=
new
byte
[
len
];
in
.
readFully
(
buf
);
in
.
readFully
(
buf
);
...
...
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