سؤال

How to write into BitSet from byteArray?

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

هل كانت مفيدة؟

المحلول

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);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top