flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientTest.java
/**
	 * Prepares a test file for the unit tests, i.e. the methods fills the file with a particular
	 * byte patterns and computes the file's BLOB key.
	 *
	 * @param file
	 * 		the file to prepare for the unit tests
	 *
	 * @return the BLOB key of the prepared file
	 *
	 * @throws IOException
	 * 		thrown if an I/O error occurs while writing to the test file
	 */
Prepares a test file for the unit tests, i.e. the methods fills the file with a particular
byte patterns and computes the file's BLOB key.

@param file
the file to prepare for the unit tests

@return the BLOB key of the prepared file

@throws IOException
thrown if an I/O error occurs while writing to the test file
Prepares a test file for the unit tests i . e . the methods fills the file with a particular byte patterns and computes the file ' s BLOB key . @param file the file to prepare for the unit tests @return the BLOB key of the prepared file @throws IOException thrown if an I / O error occurs while writing to the test file
private static byte[] prepareTestFile(File file) throws IOException {
		MessageDigest md = BlobUtils.createMessageDigest();
		final byte[] buf = new byte[TEST_BUFFER_SIZE];
		for (int i = 0; i < buf.length; ++i) {
			buf[i] = (byte) (i % 128);
		}
		FileOutputStream fos = null;
		try {
			fos = new FileOutputStream(file);
			for (int i = 0; i < 20; ++i) {
				fos.write(buf);
				md.update(buf);
			}
		} finally {
			if (fos != null) {
				fos.close();
			}
		}
		return md.digest();
	}
private static byte [ ] prepareTestFile ( File file ) throws IOException { MessageDigest md = BlobUtils . createMessageDigest ( ) ; final byte [ ] buf = new byte [ TEST_BUFFER_SIZE ] ; for ( int i = 0 ; i < buf . length ; ++ i ) { buf [ i ] = ( byte ) ( i % 128 ) ; } FileOutputStream fos = null ; try { fos = new FileOutputStream ( file ) ; for ( int i = 0 ; i < 20 ; ++ i ) { fos . write ( buf ) ; md . update ( buf ) ; } } finally { if ( fos != null ) { fos . close ( ) ; } } return md . digest ( ) ; }
Prepares a test file for the unit tests, i.e.
Prepares a test file for the unit tests i . e .