Skip to content

Instantly share code, notes, and snippets.

@maciej
Created March 6, 2017 16:16
Show Gist options
  • Select an option

  • Save maciej/6dbc8b35feaa4a808037d0f5cbae307d to your computer and use it in GitHub Desktop.

Select an option

Save maciej/6dbc8b35feaa4a808037d0f5cbae307d to your computer and use it in GitHub Desktop.
import java.io.DataInputStream
import org.roaringbitmap.buffer.MutableRoaringBitmap
object RankBug {
def main(args: Array[String]): Unit = {
val in = new DataInputStream(this.getClass.getClassLoader.getResourceAsStream("buggy-rank.bitmap"))
try {
val bitmap = new MutableRoaringBitmap()
bitmap.deserialize(in)
println(bitmap.rank(2374936))
bitmap.removeRunCompression()
println(bitmap.rank(2374936))
} finally {
in.close()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment