Alachisoft.NCache.Common.BitSetConstants Maven / Gradle / Ivy
package Alachisoft.NCache.Common;
//using System.Management;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//#endif
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !VS2003
//#endif
public class BitSetConstants {
public static final int Flattened = 1;
public static final int Compressed = 2;
public static final int WriteThru = 4;
public static final int WriteBehind = 8;
// readthru is only there for backward compatibility. one can use this bit.
public static final int ReadThru = 16;
public static final int JsonData = 32;
public static final int LockedItem = 64;
public static final int BinaryData = 128;
public static int getBitSetData(BitSet bits) {
// int value = 0;
// byte[] bytes = new byte[bits.length()/8+1];
// for (int i=0; i= 0; i--) {
if (bits.charAt(i) == '1') {
value.SetBit((byte) (int) Math.pow(2, maxIndex - i));
}
}
return value;
}
public static BitSet setBitSetData(int bits) {
BitSet value = new BitSet();
value.SetBit((byte) bits);
return value;
}
}