private static ByteSlice doDecompressIndexedStr_v1(ByteSlice cmpData, int itemSize) {
        if (itemSize == 0) {
            return ByteSlice.empty();
        }
        if (cmpData.size() == 0) {
            // itemSize > 0 and cmpData == 0 means all strings are empty.
            ByteSlice data = ByteSlice.allocateDirect((itemSize + 1) << 2);
            data.clear();
            return data;
        }
        long native_p = BhcompressLibrary.INSTANCE.JavaDecompress_IndexedString_NP_v1(cmpData.address(), itemSize);
        if (native_p == 0) {
            throw new RuntimeException("decompress string err, check the std output for error code");
        }
        int str_total_len = MemoryUtil.getInt(native_p + (itemSize << 2));
        return ByteSlice.fromAddress(native_p, ((itemSize + 1) << 2) + str_total_len, true);
    }
Wrapper of brighthouse compression.
This class is closely linked to cpp code and native data structure, don't touch it unless you know what you are doing.

Note that all values here are in unsigned form, including max_val.
indexr-segment/src/main/java/io/indexr/compress/bh/BHCompressor.java