@Test public void testGetBit() throws Exception { assertEquals(0, ArraysUtil.getBit((byte) 126, 0)); assertEquals(0, ArraysUtil.getBit((byte) 119, 4)); assertEquals(1, ArraysUtil.getBit((byte) 126, 6)); }
public static int getBit(byte _byte, int position) { position--; return _byte >> position & 1; }
ArraysUtil { public static int getBit(byte _byte, int position) { position--; return _byte >> position & 1; } }
ArraysUtil { public static int getBit(byte _byte, int position) { position--; return _byte >> position & 1; } private  ArraysUtil(); }
ArraysUtil { public static int getBit(byte _byte, int position) { position--; return _byte >> position & 1; } private  ArraysUtil(); static BitSet getBitAddress(String ip); static int bytes2int(byte[] bytes); static byte[] combine(byte[]... bytes); static byte convertBits(Boolean... bits); static byte[] copy(byte[] source); static int getBit(byte _byte, int position); static byte[] int2bytes(int value); static byte[] int2bytesCropp(int value, int nbytes2cropp); static byte[] readBytes(byte[] source, int start); static byte[] readBytes(byte[] source, int start, int length); static byte reverseBitsByte(byte x); static byte setBit(byte _byte, int position, boolean value); }
ArraysUtil { public static int getBit(byte _byte, int position) { position--; return _byte >> position & 1; } private  ArraysUtil(); static BitSet getBitAddress(String ip); static int bytes2int(byte[] bytes); static byte[] combine(byte[]... bytes); static byte convertBits(Boolean... bits); static byte[] copy(byte[] source); static int getBit(byte _byte, int position); static byte[] int2bytes(int value); static byte[] int2bytesCropp(int value, int nbytes2cropp); static byte[] readBytes(byte[] source, int start); static byte[] readBytes(byte[] source, int start, int length); static byte reverseBitsByte(byte x); static byte setBit(byte _byte, int position, boolean value);  }