Here you can find the source of decode(BitSet encoded, int encodedBitLength)
private static BitSet decode(BitSet encoded, int encodedBitLength)
//package com.java2s; //License from project: Open Source License import java.util.BitSet; public class Main { private static BitSet decode(BitSet encoded, int encodedBitLength) { int decodedBitLength = encodedBitLength - (int) (Math.log(encodedBitLength) / Math.log(2)) - 1; BitSet decoded = new BitSet(decodedBitLength); for (int i = encodedBitLength - 1, j = decodedBitLength - 1; i >= 0; --i) { if (Math.log(encodedBitLength - i) / Math.log(2) % 1 != 0) { decoded.set(j, encoded.get(i)); --j;/*from ww w . j av a 2 s . co m*/ } } return decoded; } }