Here you can find the source of bit(byte[] h, int i)
Parameter | Description |
---|---|
h | the byte array. |
i | the bit index. |
public static int bit(byte[] h, int i)
//package com.java2s; public class Main { /**//from w ww . j a v a2s . co m * Get the i'th bit of a byte array. * * @param h the byte array. * @param i the bit index. * @return 0 or 1, the value of the i'th bit in h */ public static int bit(byte[] h, int i) { return (h[i >> 3] >> (i & 7)) & 1; } }