private String escape(final String in) {
        final StringBuilder quoted = new StringBuilder((int) (in.length() * 1.2));
        return escape(in, quoted).toString();
    }
Do JSON escaping of a string.

@param in a string to escape
@return a String suitable for use in JSON strings
vespajlib/src/main/java/com/yahoo/text/JSONWriter.java