本文整理汇总了Java中com.bumptech.glide.load.Key.updateDiskCacheKey方法的典型用法代码示例。如果您正苦于以下问题:Java Key.updateDiskCacheKey方法的具体用法?Java Key.updateDiskCacheKey怎么用?Java Key.updateDiskCacheKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bumptech.glide.load.Key
的用法示例。
在下文中一共展示了Key.updateDiskCacheKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertDifferent
import com.bumptech.glide.load.Key; //导入方法依赖的package包/类
public static void assertDifferent(Key first, Key second, boolean checkDiskCacheKey)
throws NoSuchAlgorithmException {
new EqualsTester()
.addEqualityGroup(first)
.addEqualityGroup(second)
.testEquals();
if (checkDiskCacheKey) {
MessageDigest firstDigest = MessageDigest.getInstance("SHA-1");
first.updateDiskCacheKey(firstDigest);
MessageDigest secondDigest = MessageDigest.getInstance("SHA-1");
second.updateDiskCacheKey(secondDigest);
assertThat(getDigest(first)).isNotEqualTo(getDigest(second));
}
}
示例2: calculateHexStringDigest
import com.bumptech.glide.load.Key; //导入方法依赖的package包/类
private String calculateHexStringDigest(Key key) {
PoolableDigestContainer container = digestPool.acquire();
try {
key.updateDiskCacheKey(container.messageDigest);
// calling digest() will automatically reset()
return Util.sha256BytesToHex(container.messageDigest.digest());
} finally {
digestPool.release(container);
}
}
示例3: calculateHexStringDigest
import com.bumptech.glide.load.Key; //导入方法依赖的package包/类
private String calculateHexStringDigest(Key key) {
PoolableDigestContainer container = Preconditions.checkNotNull(digestPool.acquire());
try {
key.updateDiskCacheKey(container.messageDigest);
// calling digest() will automatically reset()
return Util.sha256BytesToHex(container.messageDigest.digest());
} finally {
digestPool.release(container);
}
}
示例4: getDigest
import com.bumptech.glide.load.Key; //导入方法依赖的package包/类
private byte[] getDigest(Key key) {
try {
key.updateDiskCacheKey(digest);
return digest.digest();
} finally {
digest.reset();
}
}
示例5: getDigest
import com.bumptech.glide.load.Key; //导入方法依赖的package包/类
private static byte[] getDigest(Key key) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-1");
key.updateDiskCacheKey(md);
return md.digest();
}