Create BitSet from Byte Array - Java java.util

Java examples for java.util:BitSet

Description

Create BitSet from Byte Array

Demo Code


//package com.java2s;
import java.util.BitSet;

public class Main {
    public static void main(String[] argv) throws Exception {
        byte[] bytes = new byte[] { 34, 35, 36, 37, 37, 37, 67, 68, 69 };
        System.out.println(fromByteArray(bytes));
    }//from ww w .jav a2 s. co m

    public static BitSet fromByteArray(byte[] bytes) {
        return new BitSet().valueOf(bytes);
    }
}

Related Tutorials