private static void decodeValue()

in db-protocol/mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/binlog/row/column/value/string/MySQLJsonValueDecoder.java [51:98]


    private static void decodeValue(final int type, final int offset, final ByteBuf byteBuf, final StringBuilder stringBuilder) {
        int oldOffset = byteBuf.readerIndex();
        byteBuf.readerIndex(offset);
        try {
            switch (type) {
                case JsonValueTypes.SMALL_JSON_OBJECT:
                    decodeJsonObject(true, byteBuf.slice(), stringBuilder);
                    break;
                case JsonValueTypes.LARGE_JSON_OBJECT:
                    decodeJsonObject(false, byteBuf.slice(), stringBuilder);
                    break;
                case JsonValueTypes.SMALL_JSON_ARRAY:
                    decodeJsonArray(true, byteBuf.slice(), stringBuilder);
                    break;
                case JsonValueTypes.LARGE_JSON_ARRAY:
                    decodeJsonArray(false, byteBuf.slice(), stringBuilder);
                    break;
                case JsonValueTypes.INT16:
                    stringBuilder.append(byteBuf.readShortLE());
                    break;
                case JsonValueTypes.UINT16:
                    stringBuilder.append(byteBuf.readUnsignedShortLE());
                    break;
                case JsonValueTypes.INT32:
                    stringBuilder.append(byteBuf.readIntLE());
                    break;
                case JsonValueTypes.UINT32:
                    stringBuilder.append(byteBuf.readUnsignedIntLE());
                    break;
                case JsonValueTypes.INT64:
                    stringBuilder.append(byteBuf.readLongLE());
                    break;
                case JsonValueTypes.UINT64:
                    stringBuilder.append(readUnsignedLongLE(byteBuf));
                    break;
                case JsonValueTypes.DOUBLE:
                    stringBuilder.append(byteBuf.readDoubleLE());
                    break;
                case JsonValueTypes.STRING:
                    outputString(decodeString(byteBuf.slice()), stringBuilder);
                    break;
                default:
                    throw new UnsupportedSQLOperationException(String.valueOf(type));
            }
        } finally {
            byteBuf.readerIndex(oldOffset);
        }
    }