private void mergeDoubles(DictStruct[] structs, DirectBitMap bitmap) throws IOException {
        int structSize = structs.length;
        int[] dictEntryCounts = new int[structSize];
        long[] dictEntryAddrs = new long[structSize];
        for (int i = 0; i < structSize; i++) {
            dictEntryCounts[i] = structs[i].dictEntryCount();
            dictEntryAddrs[i] = structs[i].dictEntriesAddr();
        }

        ByteBuffer bitmapMemory = (ByteBuffer) bitmap.attach;
        int[] dictOffsets = new int[structSize];

        double curEntry = Double.MAX_VALUE;
        while (true) {
            double minEntry = Double.MAX_VALUE;
            int structId = -1;
            for (int i = 0; i < structSize; i++) {
                int offset = dictOffsets[i];
                if (offset >= dictEntryCounts[i]) {
                    continue;
                }
                double e = MemoryUtil.getDouble(dictEntryAddrs[i] + (offset << 3));
                if (e <= minEntry) {
                    minEntry = e;
                    structId = i;
                }
            }
            if (structId == -1) {
                break;
            }

            // Forward offset
            dictOffsets[structId]++;

            assert minEntry >= curEntry || curEntry == Double.MAX_VALUE : String.format("%s, %s", minEntry, curEntry);

            if (minEntry <= curEntry) {
                bitmap.set(structId);
                curEntry = minEntry;
            } else {
                saveEntryDouble(curEntry, false);
                saveBitmap(bitmapMemory, false);

                curEntry = minEntry;
                bitmap.clear();
                bitmap.set(structId);
            }
        }
        saveEntryDouble(curEntry, true);
        saveBitmap(bitmapMemory, true);
    }
Delete all files generated by this class.
indexr-vlt-segment/src/main/java/io/indexr/vlt/segment/index/DictMerge.java