private boolean onNumber(int type, ByteBuffer buffer, Listener listener) {
        try {
            boolean isEmpty = buffer.remaining() == 0;
            if (isEmpty) {
                if (!numberEmptyAsZero) {
                    return false;
                }
                switch (type) {
                    case INT:
                        return listener.onIntValue(0);
                    case BIGINT:
                        return listener.onLongValue(0);
                    case FLOAT:
                        return listener.onFloatValue(0);
                    case DOUBLE:
                        return listener.onDoubleValue(0);
                    case DATE:
                        return listener.onLongValue(0);
                    case TIME:
                        return listener.onIntValue(0);
                    case DATETIME:
                        return listener.onLongValue(0);
                    default:
                        throw new IllegalStateException("illegal type " + type);
                }
            }
            if (!basicNumberCheck(buffer)) {
                return false;
            }
            switch (type) {
                case INT:
                    return listener.onIntValue((int) UTF8Util.parseLong(buffer.array(), buffer.position(), buffer.remaining()));
                case BIGINT:
                    return listener.onLongValue(UTF8Util.parseLong(buffer.array(), buffer.position(), buffer.remaining()));
                case FLOAT:
                    return listener.onFloatValue(UTF8Util.parseFloat(buffer.array(), buffer.position(), buffer.remaining()));
                case DOUBLE:
                    return listener.onDoubleValue(UTF8Util.parseDouble(buffer.array(), buffer.position(), buffer.remaining()));
                case DATE:
                    return listener.onLongValue(DateTimeUtil.parseDate(buffer.array(), buffer.position(), buffer.remaining()));
                case TIME:
                    return listener.onIntValue(DateTimeUtil.parseTime(buffer.array(), buffer.position(), buffer.remaining()));
                case DATETIME:
                    return listener.onLongValue(DateTimeUtil.parseDateTime(buffer.array(), buffer.position(), buffer.remaining()));
                default:
                    throw new IllegalStateException("illegal type " + type);
            }
        } catch (NumberFormatException e) {
            // HACK!!!
            return false;
        }
    }
A fast json deserializer which parse json in utf-8 encoding bytes directly.
Using this class to avoid the pay-off of transforming into utf-16 (i.e. java String), and generating lots of intermediate objects.
It supports multiple json objects, seperated by comma, and each object can only contains one layer. e.g.
<pre>
{"name": "Flow", "score": 4.3}, {"title": "You know \"nothing\"! Jon Snow."}
</pre>
indexr-common/src/main/java/io/indexr/util/UTF8JsonDeserializer.java