Skip to content

rdupuis/BitSetCompat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

BitSetCompat: A BitSet compatibility class

Context

New methods have been added to the BitSet class since Android Kitkat, and the Android API does not help us with native compatibility class.

Description

BitSet compatibility class for working with both pre-Kitkat and post-Kitkat versions of Android

This is a compatibility class to have the methods equivalents for:

  • BitSet valueOf (byte[] bytes)
  • byte[] toByteArray ()

Code example

// For post-Kitkat
BitSet bitset = BitSet.valueOf(bytes);
bitset.toByteArray();

// For both post and pre-Kitkat
BitSet bitset = BitSetCompat.valueOf(byteArrayToConvert)
byte[] bytes = BitSetCompat.toByteArray(bitSet);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages