@@ -29,17 +29,13 @@ public class UTF8JsonGenerator
29
29
// intermediate copies only made up to certain length...
30
30
private final static int MAX_BYTES_TO_BUFFER = 512 ;
31
31
32
- private final static byte [] HEX_CHARS_UPPER = CharTypes .copyHexBytes (true );
33
- private final static byte [] HEX_CHARS_LOWER = CharTypes .copyHexBytes (false );
32
+ private final static byte [] HEX_BYTES_UPPER = CharTypes .copyHexBytes (true );
33
+ private final static byte [] HEX_BYTES_LOWER = CharTypes .copyHexBytes (false );
34
34
35
35
private final static byte [] NULL_BYTES = { 'n' , 'u' , 'l' , 'l' };
36
36
private final static byte [] TRUE_BYTES = { 't' , 'r' , 'u' , 'e' };
37
37
private final static byte [] FALSE_BYTES = { 'f' , 'a' , 'l' , 's' , 'e' };
38
38
39
- private byte [] getHexChars () {
40
- return _cfgWriteHexUppercase ? HEX_CHARS_UPPER : HEX_CHARS_LOWER ;
41
- }
42
-
43
39
/*
44
40
/**********************************************************
45
41
/* Configuration
@@ -2141,7 +2137,7 @@ protected final void _outputSurrogates(int surr1, int surr2) throws IOException
2141
2137
*/
2142
2138
private final int _outputMultiByteChar (int ch , int outputPtr ) throws IOException
2143
2139
{
2144
- byte [] HEX_CHARS = getHexChars ();
2140
+ byte [] HEX_CHARS = getHexBytes ();
2145
2141
byte [] bbuf = _outputBuffer ;
2146
2142
if (ch >= SURR1_FIRST && ch <= SURR2_LAST ) { // yes, outside of BMP; add an escape
2147
2143
// 23-Nov-2015, tatu: As per [core#223], may or may not want escapes;
@@ -2181,7 +2177,7 @@ private final void _writeNull() throws IOException
2181
2177
private int _writeGenericEscape (int charToEscape , int outputPtr ) throws IOException
2182
2178
{
2183
2179
final byte [] bbuf = _outputBuffer ;
2184
- byte [] HEX_CHARS = getHexChars ();
2180
+ byte [] HEX_CHARS = getHexBytes ();
2185
2181
bbuf [outputPtr ++] = BYTE_BACKSLASH ;
2186
2182
bbuf [outputPtr ++] = BYTE_u ;
2187
2183
if (charToEscape > 0xFF ) {
@@ -2207,4 +2203,9 @@ protected final void _flushBuffer() throws IOException
2207
2203
_outputStream .write (_outputBuffer , 0 , len );
2208
2204
}
2209
2205
}
2206
+
2207
+ private byte [] getHexBytes () {
2208
+ return _cfgWriteHexUppercase ? HEX_BYTES_UPPER : HEX_BYTES_LOWER ;
2209
+ }
2210
2210
}
2211
+
0 commit comments