shade.com.alibaba.fastjson2.JSONWriterUTF8JDK9 Maven / Gradle / Ivy
package com.alibaba.fastjson2;
import static com.alibaba.fastjson2.util.JDKUtils.*;
class JSONWriterUTF8JDK9
extends JSONWriterUTF8 {
JSONWriterUTF8JDK9(Context ctx) {
super(ctx);
}
@Override
public void writeString(String str) {
if (str == null) {
writeStringNull();
return;
}
int coder = STRING_CODER.applyAsInt(str);
byte[] value = STRING_VALUE.apply(str);
if (coder == 0) {
writeStringLatin1(value);
} else {
writeStringUTF16(value);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy