Java tutorial
import java.nio.ByteBuffer; import java.util.BitSet; public class Main { public static void main(String[] args) { ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[] { 1, 2, 3 }); BitSet bitset1 = BitSet.valueOf(byteBuffer); // print the sets System.out.println("Bitset1:" + bitset1); } }