Here you can find the source of readByte(BitSet bits, int startByte)
private static byte readByte(BitSet bits, int startByte)
//package com.java2s; //License from project: Apache License import java.util.BitSet; public class Main { private static byte readByte(BitSet bits, int startByte) { byte res = 0; for (int k = 0; k < 8; k++) { if (bits.get(startByte * 8 + k)) { res = (byte) (res | (1 << (7 - k))); }/*from ww w . java 2 s .c o m*/ } return res; } }