code: private int linearSearch(OMMapBufferEntry[] fileEntries, long beginOffset, int beginPosition, int endPosition) {
      for (int i = beginPosition; i <= endPosition; i++) {
        final OMMapBufferEntry entry = fileEntries[i];
        if (entry.beginOffset + entry.size > beginOffset && entry.beginOffset <= beginOffset) {
          return i;
        }
      }
      return -1;
    }
docs: This method is used in
  com.orientechnologies.orient.core.storage.fs.OMMapManagerNew#searchAmongExisting(com.orientechnologies.orient
  .core.storage.fs.OFileMMap, com.orientechnologies.orient.core.storage.fs.OMMapBufferEntry[], long, int) to search necessary
  entry.
  
  @param fileEntries
  already mapped entries.
  @param beginOffset
  position in file that should be mmaped.
  @param beginPosition
  first position in fileEntries.
  @param endPosition
  last position in fileEntries.
  @return -1 if entries is not found. Otherwise returns position of necessary file entry.