SparseImageUtil

public class SparseImageUtil
extends Object

java.lang.Object
com.android.tradefed.util.SparseImageUtil


Tiện ích để bỏ qua hình ảnh thưa thớt.

Đoạn mã này được lấy từ: frameworks/base/packages/DynamicSystemInstallationService/src/com/android/dynsystem/SparseInputStream.java

Tóm tắt

Lớp lồng ghép

class SparseImageUtil.SparseInputStream

SparseInputStream đọc từ luồng tải lên và phát hiện định dạng dữ liệu. 

Hàm khởi tạo công khai

SparseImageUtil()

Phương thức công khai

static boolean isSparse(File imgFile)

Kiểm thử xem tệp có phải là hình ảnh thưa thớt hay không.

static void unsparse(File imgFile, File destFile)

Bỏ qua tệp hình ảnh thưa thớt.

Hàm khởi tạo công khai

SparseImageUtil

public SparseImageUtil ()

Phương thức công khai

isSparse

public static boolean isSparse (File imgFile)

Kiểm thử xem tệp có phải là hình ảnh thưa thớt hay không.

Tham số
imgFile File: File cần kiểm thử.

Giá trị trả về
boolean true nếu imgFile là hình ảnh thưa thớt.

unsparse

public static void unsparse (File imgFile, 
                File destFile)

Bỏ qua tệp hình ảnh thưa thớt.

Tham số
imgFile File: File là hình ảnh thưa thớt.

destFile File: File để ghi hình ảnh đã bỏ qua.

Gửi
IOException nếu imgFile không phải là hình ảnh thưa thớt.