本文整理汇总了Java中android.os.MemoryFile.close方法的典型用法代码示例。如果您正苦于以下问题:Java MemoryFile.close方法的具体用法?Java MemoryFile.close怎么用?Java MemoryFile.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.MemoryFile
的用法示例。
在下文中一共展示了MemoryFile.close方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeFileDescriptorAsPurgeable
import android.os.MemoryFile; //导入方法依赖的package包/类
protected Bitmap decodeFileDescriptorAsPurgeable(
CloseableReference<PooledByteBuffer> bytesRef,
int inputLength,
byte[] suffix,
BitmapFactory.Options options) {
MemoryFile memoryFile = null;
try {
memoryFile = copyToMemoryFile(bytesRef, inputLength, suffix);
FileDescriptor fd = getMemoryFileDescriptor(memoryFile);
Bitmap bitmap = sWebpBitmapFactory.decodeFileDescriptor(fd, null, options);
return Preconditions.checkNotNull(bitmap, "BitmapFactory returned null");
} catch (IOException e) {
throw Throwables.propagate(e);
} finally {
if (memoryFile != null) {
memoryFile.close();
}
}
}
示例2: test_webp_extended_decoding_filedescriptor_bitmap
import android.os.MemoryFile; //导入方法依赖的package包/类
@Test
public void test_webp_extended_decoding_filedescriptor_bitmap() throws Throwable {
final MemoryFile memoryFile = getMemoryFile("webp_e.webp");
final Bitmap bitmap = mWebpBitmapFactory.decodeFileDescriptor(
getMemoryFileDescriptor(memoryFile),
null,
null);
memoryFile.close();
assertBitmap(bitmap, 480, 320);
}
示例3: test_webp_extended_with_alpha_decoding_filedescriptor_bitmap
import android.os.MemoryFile; //导入方法依赖的package包/类
@Test
public void test_webp_extended_with_alpha_decoding_filedescriptor_bitmap() throws Throwable {
final MemoryFile memoryFile = getMemoryFile("webp_ea.webp");
final Bitmap bitmap = mWebpBitmapFactory.decodeFileDescriptor(
getMemoryFileDescriptor(memoryFile),
null,
null);
memoryFile.close();
assertBitmap(bitmap, 400 ,301);
}
示例4: test_webp_lossless_decoding_filedescriptor_bitmap
import android.os.MemoryFile; //导入方法依赖的package包/类
@Test
public void test_webp_lossless_decoding_filedescriptor_bitmap() throws Throwable {
final MemoryFile memoryFile = getMemoryFile("webp_ll.webp");
final Bitmap bitmap = mWebpBitmapFactory.decodeFileDescriptor(
getMemoryFileDescriptor(memoryFile),
null,
null);
memoryFile.close();
assertBitmap(bitmap, 400, 301);
}
示例5: test_webp_plain_decoding_filedescriptor_bitmap
import android.os.MemoryFile; //导入方法依赖的package包/类
@Test
public void test_webp_plain_decoding_filedescriptor_bitmap() throws Throwable {
final MemoryFile memoryFile = getMemoryFile("webp_plain.webp");
final Bitmap bitmap = mWebpBitmapFactory.decodeFileDescriptor(
getMemoryFileDescriptor(memoryFile),
null,
null);
memoryFile.close();
assertBitmap(bitmap, 320, 214);
}