class ByteUtils {

    public static int readBit(byte value, int position) {
        if (position > 7 || position < 0) {
            throw new ArrayIndexOutOfBoundsException("position must be 0 - 7.");
        }
        byte[] data = new byte[2];
        data[1] = value;
        int dataValue = new BigInteger(data).intValue();
        return dataValue >>> position;
    }

}