public static HyperLogLogCollector makeCollector ( ByteBuffer buffer ) { int remaining = buffer . remaining ( ) ; if ( remaining % 3 == 0 || remaining == 1027 ) { return new VersionZeroHyperLogLogCollector ( buffer ) ; } else { return new VersionOneHyperLogLogCollector ( buffer ) ; } }
Create a wrapper object around an HLL sketch contained within a buffer . The position and limit of the buffer may be changed ; if you do not want this to happen you can duplicate the buffer before passing it in .