code: static boolean isSameBits(BitReader r, BitReader s) {
  		int rBit;
  		int sBit;
  		do {
  			try {
  				rBit = r.readBit();
  			} catch (EndOfBitStreamException e) {
  				rBit = -1;
  			}
  			try {
  				sBit = s.readBit();
  			} catch (EndOfBitStreamException e) {
  				sBit = -1;
  			}
  			if (rBit != sBit) return false;
  		} while (rBit != -1);
  		return true;
  	}
docs: package scoped