本文整理了Java中org.broadinstitute.gatk.utils.Utils.calcMD5()
方法的一些代码示例,展示了Utils.calcMD5()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.calcMD5()
方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.Utils
类名称:Utils
方法名:calcMD5
暂无
代码示例来源:origin: broadgsa/gatk
/**
* @see #calcMD5(byte[])
*/
public static String calcMD5(final String s) {
return calcMD5(s.getBytes());
}
代码示例来源:origin: broadgsa/gatk
@Test
public void testCalcMD5() throws Exception {
final File source = new File(publicTestDir + "exampleFASTA.fasta");
final String sourceMD5 = "36880691cf9e4178216f7b52e8d85fbe";
final byte[] sourceBytes = IOUtils.readFileIntoByteArray(source);
Assert.assertEquals(Utils.calcMD5(sourceBytes), sourceMD5);
final String sourceString = FileUtils.readFileToString(source);
Assert.assertEquals(Utils.calcMD5(sourceString), sourceMD5);
}
代码示例来源:origin: broadgsa/gatk
/**
* Calculates the MD5 for the specified file and returns it as a String
*
* @param file file whose MD5 to calculate
* @return file's MD5 in String form
* @throws RuntimeException if the file could not be read
*/
public String calculateFileMD5( final File file ) {
try {
return Utils.calcMD5(getBytesFromFile(file));
}
catch ( Exception e ) {
throw new RuntimeException("Failed to read bytes from file: " + file + " for MD5 calculation", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!