Here you can find the source of bitAt(int offset, byte aByte)
Parameter | Description |
---|---|
offset | A zero indexed offset for the bits in the byte. [0,7] |
aByte | An input byte. |
public static boolean bitAt(int offset, byte aByte)
//package com.java2s; //License from project: Apache License public class Main { /**//from w ww.jav a 2 s .c o m * Examine the values of bits within a byte. * * @param offset A zero indexed offset for the bits in the byte. [0,7] * @param aByte An input byte. * @return The bit value of the byte at the given offset. */ public static boolean bitAt(int offset, byte aByte) { return (aByte & (1 << offset)) != 0; } }