code: public static long getChecksum(final File file, final boolean crc)
  		throws FileNotFoundException, IOException
  	{
  		try (CheckedInputStream cis = crc
  			? new CheckedInputStream(new FileInputStream(file), new CRC32())
  			: new CheckedInputStream(new FileInputStream(file), new Adler32());)
  		{
  			final int length = (int)file.length();
  			final byte[] buffer = new byte[length];
  			long checksum = 0;
  			while (cis.read(buffer) >= 0)
  			{
  				checksum = cis.getChecksum().getValue();
  			}
  			checksum = cis.getChecksum().getValue();
  			return checksum;
  		}
  	}
docs: Gets the checksum from the given file. If the flag crc is true than the CheckedInputStream is
  constructed with an instance of <code>java.util.zip.CRC32</code> otherwise with an instance
  of <code>java.util.zip.Adler32</code>.
  
  @param file
  The file The file from what to get the checksum.
  @param crc
  The crc If the flag crc is true than the CheckedInputStream is constructed with an
  instance of {@link java.util.zip.CRC32} object otherwise it is constructed with an
  instance of
  @return The checksum from the given file as long.
  @throws FileNotFoundException
  Is thrown if the file is not found.
  @throws IOException
  Signals that an I/O exception has occurred. {@link java.util.zip.CRC32} object
  otherwise it is constructed with an instance of {@link java.util.zip.Adler32}
  object. {@link java.util.zip.Adler32} object.