public void skipBytes(long length) throws IOException {
  long skipped=0;
  while (skipped < length) {
    int val=in.read();
    if (val < 0) {
      throw new IOException("Unexpected end of input");
    }
    skipped++;
  }
  bytesRead+=length;
}

public void skipBytes ( long length ) throws IOException { long skipped = 0 ; while ( skipped < length ) { int val = in . read ( ) ; if ( val < 0 ) { throw new IOException ( "Unexpected end of input" ) ; } skipped ++ ; } bytesRead += length ; }
skip a number of bytes from the input stream
