code: public Long indexOf(File f, byte[] searchBytes, long fromPosition) {
  
  		final List<Long> result;
  		if (USE_NIO) {
  
  			result = searchPartiallyUsingNIO(f, searchBytes, fromPosition, -1, new BinFileProgressListener() {
  
  				@Override
  				public void onProgress(List<Long> pointerList, float progress, float currentPosition, float startPosition, long maxSizeToRead) {
  
  					if (bigFileProgressListener != null) {
  						bigFileProgressListener.onProgress(pointerList, progress, currentPosition, startPosition, maxSizeToRead);
  					}
  
  					if (pointerList.size() > 0) {
  						BinFileSearcher.this.stop();
  					}
  				}
  			});
  
  		} else {
  
  			result = searchPartiallyUsingLegacy(f, searchBytes, fromPosition, -1, new BinFileProgressListener() {
  
  				@Override
  				public void onProgress(List<Long> pointerList, float progress, float currentPosition, float startPosition, long maxSizeToRead) {
  
  					if (bigFileProgressListener != null) {
  						bigFileProgressListener.onProgress(pointerList, progress, currentPosition, startPosition, maxSizeToRead);
  					}
  
  					if (pointerList.size() > 0) {
  						BinFileSearcher.this.stop();
  					}
  				}
  			});
  		}
  		if (result.size() > 0) {
  			return result.get(0);
  		} else {
  			return -1L;
  		}
  	}
docs: Returns the index within this file of the first occurrence of the
  specified substring, starting at the specified position.
  
  @param f
  target file
  @param searchBytes
  a sequence of bytes you want to find
  @param fromPosition
  "0" means the beginning of the file
  @return position of the first occurence. '-1' means that it was not
  found.