public static boolean seekAtOrAfter(HFileScanner s, ExtendedCell k) throws IOException {
    int result = s.seekTo(k);
    if (result < 0) {
      if (result == HConstants.INDEX_KEY_MAGIC) {
        // using faked key
        return true;
      }
      // Passed KV is smaller than first KV in file, work from start of file
      return s.seekTo();
    } else if (result > 0) {
      // Passed KV is larger than current KV in file, if there is a next
      // it is the "after", if not then this scanner is done.
      return s.next();
    }
    // Seeked to the exact key
    return true;
  }
Returns false if not found or if k is after the end.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java