@Test public void testReverseBitsByte() throws Exception { assertEquals(0, ArraysUtil.reverseBitsByte((byte) 0)); assertEquals(-1, ArraysUtil.reverseBitsByte((byte) 255)); assertEquals(12, ArraysUtil.reverseBitsByte((byte) 48)); assertEquals(125, ArraysUtil.reverseBitsByte((byte) 190)); }
public static byte reverseBitsByte(byte x) { int intSize = 8; byte y = 0; for (int position = intSize - 1; position >= 0; position--) { y += ((x & 1) << position); x >>= 1; } return y; }
ArraysUtil { public static byte reverseBitsByte(byte x) { int intSize = 8; byte y = 0; for (int position = intSize - 1; position >= 0; position--) { y += ((x & 1) << position); x >>= 1; } return y; } }
ArraysUtil { public static byte reverseBitsByte(byte x) { int intSize = 8; byte y = 0; for (int position = intSize - 1; position >= 0; position--) { y += ((x & 1) << position); x >>= 1; } return y; } private  ArraysUtil(); }
ArraysUtil { public static byte reverseBitsByte(byte x) { int intSize = 8; byte y = 0; for (int position = intSize - 1; position >= 0; position--) { y += ((x & 1) << position); x >>= 1; } return y; } 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 byte reverseBitsByte(byte x) { int intSize = 8; byte y = 0; for (int position = intSize - 1; position >= 0; position--) { y += ((x & 1) << position); x >>= 1; } return y; } 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);  }