public static void printJsonString(Appendable out, CharSequence text)
        throws IOException
    {
        if (text == null)
        {
            out.append("null");
        }
        else
        {
            out.append('"');
            printCodePoints(out, text, EscapeMode.JSON);
            out.append('"');
        }
    }
public static void printJsonString ( Appendable out , CharSequence text ) throws IOException { if ( text == null ) { out . append ( "null" ) ; } else { out . append ( '"' ) ; printCodePoints ( out , text , EscapeMode . JSON ) ; out . append ( '"' ) ; } }
Prints characters as an ASCII-encoded JSON string, including surrounding
double-quotes.
If the {@code text} is null, this prints {@code null}.

@param out the stream to receive the JSON data.
@param text the text to print; may be {@code null}.

@throws IOException if the {@link Appendable} throws an exception.
@throws IllegalArgumentException
if the text contains invalid UTF-16 surrogates.