code: public long findFirstSet(long start, byte[] temp) throws IOException {
          long pos = start >> 3;
          try {
              lock().acquireReadLock();
              while (true) {
                  int amt = mFile.read(pos, temp, 0, temp.length);
                  if (amt <= 0) {
                      return -1;
                  }
                  for (int i=0; i<amt; i++, pos++) {
                      byte val;
                      if ((val = temp[i]) != 0) {
                          long index = pos << 3;
                          if (index < start) {
                              // Clear the upper bits to skip check.
                              val &= (0x000000ff >>> (start - index));
                              if (val == 0) {
                                  // False alarm.
                                  continue;
                              }
                          }
                          return index + findSubIndex(val);
                      }
                  }
              }
          }
          catch (InterruptedException e) {
              throw new InterruptedIOException();
          }
          finally {
              lock().releaseLock();
          }
      }
docs: Searches the bitlist for the first set bit and returns the index to it.
  
  @param start first index to begin search.
  @param temp temporary byte array for loading bits.
  @return index to first set bit or -1 if not found.