FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java/src/main/java/com/jsoniter/JsonIteratorPool.java at master · sowapplication/java · GitHub
sowapplication
/
java
Public
forked from
json-iterator/java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java
/
src
/
main
/
java
/
com
/
jsoniter
/
JsonIteratorPool.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (31 loc) · 948 Bytes
Breadcrumbs
java
/
src
/
main
/
java
/
com
/
jsoniter
/
JsonIteratorPool.java
Copy path
File metadata and controls
35 lines (31 loc) · 948 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package
com
.
jsoniter
;
public
class
JsonIteratorPool
{
private
static
ThreadLocal
<
JsonIterator
>
slot1
=
new
ThreadLocal
<
JsonIterator
>();
private
static
ThreadLocal
<
JsonIterator
>
slot2
=
new
ThreadLocal
<
JsonIterator
>();
public
static
JsonIterator
borrowJsonIterator
() {
JsonIterator
iter
=
slot1
.
get
();
if
(
iter
!=
null
) {
slot1
.
set
(
null
);
return
iter
;
}
iter
=
slot2
.
get
();
if
(
iter
!=
null
) {
slot2
.
set
(
null
);
return
iter
;
}
iter
=
JsonIterator
.
parse
(
new
byte
[
512
],
0
,
0
);
return
iter
;
}
public
static
void
returnJsonIterator
(
JsonIterator
iter
) {
iter
.
configCache
=
null
;
iter
.
existingObject
=
null
;
if
(
slot1
.
get
() ==
null
) {
slot1
.
set
(
iter
);
return
;
}
if
(
slot2
.
get
() ==
null
) {
slot2
.
set
(
iter
);
return
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL