Description
Currently it always does 4 passes over the data (one per byte, since ints have 4 bytes). However, most of the time, we know maxDoc, so we can use this information to do fewer passes when they are not necessary. For instance, if maxDoc is less than or equal to 2^24, we only need 3 passes, and if maxDoc is less than or equals to 2^16, we only need two passes.