app/src/main/java/fi/finwe/orion360/sdk/pro/examples/MainMenu.java
private long crc32(String filepath) {
		CRC32 checksum = new CRC32();
		checksum.reset();
		byte [] buffer = new byte[1024];
		InputStream in = null;
		try {
			in = new FileInputStream(filepath);
			int read;
			while (( read = in.read(buffer) ) != -1 ) {
				checksum.update(buffer, 0, read);
			}
		} catch (IOException e) {
			Log.e(TAG, "Failed to calculate CRC32 checksum from file " + filepath);
		} finally {
			if (null != in) {
				try { in.close(); } catch (IOException e) { Log.e(TAG, "Failed to close stream."); }
			}
		}
		return checksum.getValue();
	}
/**
	 * Calculates the CRC checksum value from the given file.
	 *
	 * @param filepath The full path to the file to whose checksum to calculate.
	 * @return the calculated CRC value.
	 */
Calculates the CRC checksum value from the given file.
@param filepath The full path to the file to whose checksum to calculate.
@return the calculated CRC value.
Calculates the CRC checksum value from the given file . @param filepath The full path to the file to whose checksum to calculate . @return the calculated CRC value .
private long crc32(String filepath) {
		CRC32 checksum = new CRC32();
		checksum.reset();
		byte [] buffer = new byte[1024];
		InputStream in = null;
		try {
			in = new FileInputStream(filepath);
			int read;
			while (( read = in.read(buffer) ) != -1 ) {
				checksum.update(buffer, 0, read);
			}
		} catch (IOException e) {
			Log.e(TAG, "Failed to calculate CRC32 checksum from file " + filepath);
		} finally {
			if (null != in) {
				try { in.close(); } catch (IOException e) { Log.e(TAG, "Failed to close stream."); }
			}
		}
		return checksum.getValue();
	}
private long crc32 ( String filepath ) { CRC32 checksum = new CRC32 ( ) ; checksum . reset ( ) ; byte [ ] buffer = new byte [ 1024 ] ; InputStream in = null ; try { in = new FileInputStream ( filepath ) ; int read ; while ( ( read = in . read ( buffer ) ) != - 1 ) { checksum . update ( buffer , 0 , read ) ; } } catch ( IOException e ) { Log . e ( TAG , "Failed to calculate CRC32 checksum from file " + filepath ) ; } finally { if ( null != in ) { try { in . close ( ) ; } catch ( IOException e ) { Log . e ( TAG , "Failed to close stream." ) ; } } } return checksum . getValue ( ) ; }
Calculates the CRC checksum value from the given file.
Calculates the CRC checksum value from the given file .