Skip to content

Commit 7cdbed6

Browse files
committed
remove unused code
1 parent 4c88099 commit 7cdbed6

File tree

2 files changed

+0
-100
lines changed

2 files changed

+0
-100
lines changed

src/main/java/com/jsoniter/output/AsciiOutputStream.java

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
package com.jsoniter.output;
22

3-
import java.io.ByteArrayOutputStream;
4-
53
public class JsonStreamPool {
64

75
private final static ThreadLocal<JsonStream> slot1 = new ThreadLocal<JsonStream>();
86
private final static ThreadLocal<JsonStream> slot2 = new ThreadLocal<JsonStream>();
9-
private final static ThreadLocal<AsciiOutputStream> osSlot1 = new ThreadLocal<AsciiOutputStream>();
10-
private final static ThreadLocal<AsciiOutputStream> osSlot2 = new ThreadLocal<AsciiOutputStream>();
11-
private final static ThreadLocal<ByteArrayOutputStream> baosSlot1 = new ThreadLocal<ByteArrayOutputStream>();
12-
private final static ThreadLocal<ByteArrayOutputStream> baosSlot2 = new ThreadLocal<ByteArrayOutputStream>();
137

148
public static JsonStream borrowJsonStream() {
159
JsonStream stream = slot1.get();
@@ -38,53 +32,4 @@ public static void returnJsonStream(JsonStream jsonStream) {
3832
}
3933
}
4034

41-
public static AsciiOutputStream borrowAsciiOutputStream() {
42-
AsciiOutputStream stream = osSlot1.get();
43-
if (stream != null) {
44-
osSlot1.set(null);
45-
return stream;
46-
}
47-
stream = osSlot2.get();
48-
if (stream != null) {
49-
osSlot2.set(null);
50-
return stream;
51-
}
52-
return new AsciiOutputStream();
53-
}
54-
55-
public static void returnAsciiOutputStream(AsciiOutputStream asciiOutputStream) {
56-
if (osSlot1.get() == null) {
57-
osSlot1.set(asciiOutputStream);
58-
return;
59-
}
60-
if (osSlot2.get() == null) {
61-
osSlot2.set(asciiOutputStream);
62-
return;
63-
}
64-
}
65-
66-
public static ByteArrayOutputStream borrowByteArrayOutputStream() {
67-
ByteArrayOutputStream stream = baosSlot1.get();
68-
if (stream != null) {
69-
osSlot1.set(null);
70-
return stream;
71-
}
72-
stream = baosSlot2.get();
73-
if (stream != null) {
74-
osSlot2.set(null);
75-
return stream;
76-
}
77-
return new ByteArrayOutputStream();
78-
}
79-
80-
public static void returnByteArrayOutputStream(ByteArrayOutputStream baos) {
81-
if (baosSlot1.get() == null) {
82-
baosSlot1.set(baos);
83-
return;
84-
}
85-
if (baosSlot2.get() == null) {
86-
baosSlot2.set(baos);
87-
return;
88-
}
89-
}
9035
}

0 commit comments

Comments
 (0)