user3495562
user3495562

Reputation: 335

How to write into BitSet from byteArray? (we need java 1.7)

How to write into BitSet from byteArray?

Say if I have a byte[] bytearray how to input this to a BitSet?

Upvotes: 1

Views: 393

Answers (1)

Suresh Atta
Suresh Atta

Reputation: 121998

If you refer docs of BitSet , there is valueOf() method

public static BitSet valueOf(byte[] bytes)

Returns a new bit set containing all the bits in the given byte array.

 BitSet a = BitSet.valueOf(test);

Upvotes: 1

Related Questions