public int skipFully(int n) throws IOException {
  int total=0;
  int cur;
  while (total < n && (cur=(int)in.skip(n - total)) > 0) {
    total+=cur;
  }
  return total;
}

public int skipFully ( int n ) throws IOException { int total = 0 ; int cur ; while ( total < n && ( cur = ( int ) in . skip ( n - total ) ) > 0 ) { total += cur ; } return total ; }
skips the specified number of bytes .
