Code example for CheckedInputStream

0
        if (file.isDirectory()) {
            throw new IllegalArgumentException("Checksums can't be computed on directories");
        } 
        InputStream in = null;
        try { 
            in = new CheckedInputStream(new FileInputStream(file), checksum);
            IOUtils.copy(in, new NullOutputStream());
        } finally { 
            IOUtils.closeQuietly(in);
        } 
        return checksum;
    } 
 
    /** 
     * Moves a directory. 
     * <p> 
     * When the destination directory is on another file system, do a "copy and delete". 
     * 
     * @param srcDir the directory to be moved 
     * @param destDir the destination directory 
Contextual code suggestions in your IDE  Get Codota for Java