@Override public int read() throws IOException {
  int x=in.read();
  if (x != -1) {
    check.update(x);
  }
  return x;
}

@ Override public int read ( ) throws IOException { int x = in . read ( ) ; if ( x != - 1 ) { check . update ( x ) ; } return x ; }
reads one byte of data from the underlying input stream and updates the checksum with the byte data .
