This commit is contained in:
@@ -95,14 +95,16 @@ public class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
// return configWrite(new JsonStreamWriter(tiny, charset, out));
|
// return configWrite(new JsonStreamWriter(tiny, charset, out));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public JsonWriter pollJsonWriter() {
|
|
||||||
// return configWrite(writerPool.get().tiny(tiny));
|
private JsonWriter pollJsonWriter() {
|
||||||
// }
|
return configWrite(writerPool.get().tiny(tiny));
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// public void offerJsonWriter(final JsonWriter writer) {
|
// public void offerJsonWriter(final JsonWriter writer) {
|
||||||
// if (writer != null) writerPool.accept(writer);
|
// if (writer != null) writerPool.accept(writer);
|
||||||
// }
|
// }
|
||||||
//------------------------------ convertFrom -----------------------------------------------------------
|
//------------------------------ convertFrom -----------------------------------------------------------
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T convertFrom(final Type type, final byte[] bytes) {
|
public <T> T convertFrom(final Type type, final byte[] bytes) {
|
||||||
if (bytes == null) return null;
|
if (bytes == null) return null;
|
||||||
@@ -215,7 +217,7 @@ public class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
public String convertTo(final Type type, final Object value) {
|
public String convertTo(final Type type, final Object value) {
|
||||||
if (type == null) return null;
|
if (type == null) return null;
|
||||||
if (value == null) return "null";
|
if (value == null) return "null";
|
||||||
JsonWriter writer = writerPool.get();// pollJsonWriter();
|
JsonWriter writer = pollJsonWriter();
|
||||||
if (writer == null) {
|
if (writer == null) {
|
||||||
writer = new JsonWriter();
|
writer = new JsonWriter();
|
||||||
} else {
|
} else {
|
||||||
@@ -243,7 +245,7 @@ public class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
public byte[] convertToBytes(final Type type, final Object value) {
|
public byte[] convertToBytes(final Type type, final Object value) {
|
||||||
if (type == null) return null;
|
if (type == null) return null;
|
||||||
if (value == null) return null;
|
if (value == null) return null;
|
||||||
JsonWriter writer = writerPool.get();// pollJsonWriter();
|
JsonWriter writer = pollJsonWriter();
|
||||||
if (writer == null) {
|
if (writer == null) {
|
||||||
writer = new JsonWriter();
|
writer = new JsonWriter();
|
||||||
} else {
|
} else {
|
||||||
@@ -263,7 +265,7 @@ public class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
@Override
|
@Override
|
||||||
public String convertMapTo(final Object... values) {
|
public String convertMapTo(final Object... values) {
|
||||||
if (values == null) return "null";
|
if (values == null) return "null";
|
||||||
JsonWriter writer = writerPool.get();// pollJsonWriter();
|
JsonWriter writer = pollJsonWriter();
|
||||||
if (writer == null) {
|
if (writer == null) {
|
||||||
writer = new JsonWriter();
|
writer = new JsonWriter();
|
||||||
} else {
|
} else {
|
||||||
@@ -292,7 +294,7 @@ public class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
if (value == null) {
|
if (value == null) {
|
||||||
pollJsonWriter(out).writeNull();
|
pollJsonWriter(out).writeNull();
|
||||||
} else {
|
} else {
|
||||||
JsonWriter writer = writerPool.get();// pollJsonWriter();
|
JsonWriter writer = pollJsonWriter();
|
||||||
if (writer == null) {
|
if (writer == null) {
|
||||||
writer = new JsonWriter();
|
writer = new JsonWriter();
|
||||||
} else {
|
} else {
|
||||||
@@ -318,7 +320,7 @@ public class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
if (values == null) {
|
if (values == null) {
|
||||||
pollJsonWriter(out).writeNull();
|
pollJsonWriter(out).writeNull();
|
||||||
} else {
|
} else {
|
||||||
JsonWriter writer = writerPool.get();// pollJsonWriter();
|
JsonWriter writer = pollJsonWriter();
|
||||||
if (writer == null) {
|
if (writer == null) {
|
||||||
writer = new JsonWriter();
|
writer = new JsonWriter();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user