@SuppressWarnings("fallthrough")
    private void decodeNumber(Inserter inserter) {
        buf.reset();
        boolean likelyFloatingPoint = false;
        for (;;) {
            switch (c) {
                case '.': case 'e': case 'E':
                    likelyFloatingPoint = true;
                case '0': case '1': case '2': case '3': case '4':
                case '5': case '6': case '7': case '8': case '9':
                case '+': case '-':
                    buf.put(c);
                    next();
                    break;
                default:
                    if (likelyFloatingPoint) {
                        double num = Double.parseDouble(buf.toString(StandardCharsets.UTF_8));
                        inserter.insertDOUBLE(num);
                    } else {
                        long num = Long.parseLong(buf.toString(StandardCharsets.UTF_8));
                        inserter.insertLONG(num);
                    }
                    return;
            }
        }
    }
Decode bytes as a UTF-8 JSON into Slime, or throw {@link JsonParseException} on invalid JSON.
vespajlib/src/main/java/com/yahoo/slime/JsonDecoder.java