static private long skipForward(InputStream is,long toSkip) throws IOException {
  long eachSkip=0;
  long skipped=0;
  while (skipped != toSkip) {
    eachSkip=is.skip(toSkip - skipped);
    if (eachSkip <= 0) {
      if (is.read() == -1) {
        return skipped;
      }
 else {
        skipped++;
      }
    }
    skipped+=eachSkip;
  }
  return skipped;
}

static private long skipForward ( InputStream is , long toSkip ) throws IOException { long eachSkip = 0 ; long skipped = 0 ; while ( skipped != toSkip ) { eachSkip = is . skip ( toSkip - skipped ) ; if ( eachSkip <= 0 ) { if ( is . read ( ) == - 1 ) { return skipped ; } else { skipped ++ ; } } skipped += eachSkip ; } return skipped ; }
skips through the specified number of bytes from the stream until either eof is reached , or the specified number of bytes have been skipped
