@ Override public void close ( ) throws IOException { if ( currentOffset < dataLength ) { byte [ ] t = new byte [ Math . min ( ( int ) ( Integer . MAX_VALUE & ( dataLength - currentOffset ) ) , 32 * 1024 ) ] ; while ( currentOffset < dataLength ) { int n = read ( t , 0 , t . length ) ; if ( 0 == n ) { throw new EOFException ( "Could not validate checksum" ) ; } } } in . close ( ) ; }
Close the input stream . Note that we need to read to the end of the stream to validate the checksum .