Here you can find the source of reverse(final BitSet bitset, final int sizeInBits)
public static BitSet reverse(final BitSet bitset, final int sizeInBits)
//package com.java2s; //License from project: Apache License import java.util.BitSet; public class Main { public static BitSet reverse(final BitSet bitset, final int sizeInBits) { final BitSet reversed = new BitSet(); int reversedIndex = 0; for (int i = sizeInBits - 1; i >= 0; i--) { if (bitset.get(i)) { reversed.set(reversedIndex); }//from www.ja v a 2 s . co m reversedIndex++; } return reversed; } }