Here you can find the source of bitAt(byte b, int pos)
static int bitAt(byte b, int pos)
//package com.java2s; //License from project: Apache License public class Main { static int bitAt(byte b, int pos) { int i = 1 << 7 - pos; return (b & i & 0xFF) > 0 ? 1 : 0; }/*from w ww.j av a 2s . c o m*/ }