fastestFormatAndBits

fun fastestFormatAndBits(valueCount: Int, bitsPerValue: Int, acceptableOverheadRatio: Float): PackedInts.FormatAndBits

Try to find the Format and number of bits per value that would restore from disk the fastest reader whose overhead is less than acceptableOverheadRatio.

The acceptableOverheadRatio parameter makes sense for random-access [ ]s. In case you only plan to perform sequential access on this stream later on, you should probably use PackedInts.COMPACT.

If you don't know how many values you are going to write, use valueCount = -1.