com.alachisoft.ncache.serialization.util.SerializationBitSetConstant Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-serialization Show documentation
Show all versions of nc-serialization Show documentation
Internal package of Alachisoft.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.alachisoft.ncache.serialization.util;
/**
* @author numan_hanif
*/
public class SerializationBitSetConstant {
public static final int Flattened = 1;
public static final int Compressed = 2;
public static final int WriteThru = 4;
public static final int WriteBehind = 8;
public static final int ReadThru = 16;
public static final int LockItem = 64;
public static final int Utf8Encoded = 32;
public static final int BinaryData = 128;
public static int getBitSetData(SerializationBitSet 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 SerializationBitSet setBitSetData(int bits) {
SerializationBitSet value = new SerializationBitSet();
value.SetBit((byte) bits);
return value;
}
}