private void escape(final String in, final StringBuilder target) {
        for (final char c : in.toCharArray()) {
            switch (c) {
            case ('"'):
                target.append("\\\"");
                break;
            case ('\\'):
                target.append("\\\\");
                break;
            case ('\b'):
                target.append("\\b");
                break;
            case ('\f'):
                target.append("\\f");
                break;
            case ('\n'):
                target.append("\\n");
                break;
            case ('\r'):
                target.append("\\r");
                break;
            case ('\t'):
                target.append("\\t");
                break;
            default:
                if (c < 32) {
                    target.append("\\u").append(fourDigitHexString(c));
                } else {
                    target.append(c);
                }
                break;
            }
        }
    }
Convert simple metrics snapshots into jdisc state snapshots.

@author arnej27959
container-core/src/main/java/com/yahoo/metrics/simple/jdisc/SnapshotConverter.java