docs: public static long seekBack(File f, int count, String marker, Predicate<InputStream> validity) throws IOException {
          FileInputStream fis = new FileInputStream(f);
          long size = fis.getChannel().size();
          long pos = size;
          long foundpos = -1;
          //seek backwards for *count occurrences of the marker
          pos = pos - marker.length();
          boolean done = false;
          char[] comp = marker.toCharArray();
          byte[] buf = new byte[marker.length()];
          int matchcount = 0;
          while (matchcount < count && !done && pos >= 0) {
              fis.getChannel().position(pos);
              int r = fis.read(buf);
              if (r == marker.length()) {
                  //compare contents of buf with comparison, and cycle forward if marker > 1 char length
                  int cycle = 0;
                  boolean bmatch = false;
                  int j = 0;
                  for (cycle = 0; cycle < marker.length(); cycle++) {
                      boolean cmatch = true;
                      for (j = 0; j < (buf.length - cycle); j++) {
                          if (buf[j] != (byte) comp[j + cycle]) {
                              cmatch = false;
                              break;
                          }
                      }
                      if (cmatch) {
                          bmatch = true;
                          break;
                      }
                  }
                  if (bmatch) {
                      //matched the buffer with the comparison at point 'cycle'.
                      //if cycle is 0, then  found one count. otherwise, backup
                      if (0 == cycle) {
                          if (null == validity || validity.apply(fis)) {
                              matchcount++;
                              foundpos = pos;
                          }
                          pos -= marker.length();
                      } else {
                          pos -= cycle;
                      }
                  } else {
                      pos -= marker.length();
                  }
              } else {
  //                System.err.println("unable to read " + marker.length() + " bytes...");
                  done = true;
              }
          }
  //        System.err.println("matchcount > count? "+(matchcount > count)+", done: "+done+", pos: "+pos);
          if(pos<=0){
  //            System.err.println("setting foundpos to 0");
              foundpos=0;
          }
          fis.close();
          return foundpos;
      }