MCPcopy Index your code
hub / github.com/wyouflf/xUtils3 / isGif

Method isGif

xutils/src/main/java/org/xutils/image/ImageDecoder.java:140–153  ·  view source on GitHub ↗
(File file)

Source from the content-addressed store, hash-verified

138 }
139
140 public static boolean isGif(File file) {
141 FileInputStream in = null;
142 try {
143 in = new FileInputStream(file);
144 byte[] header = IOUtil.readBytes(in, 0, 3);
145 return Arrays.equals(GIF_HEADER, header);
146 } catch (Throwable ex) {
147 LogUtil.e(ex.getMessage(), ex);
148 } finally {
149 IOUtil.closeQuietly(in);
150 }
151
152 return false;
153 }
154
155 /**
156 * 转化文件为Bitmap.

Callers 1

decodeFileWithLockMethod · 0.95

Calls 5

readBytesMethod · 0.95
eMethod · 0.95
closeQuietlyMethod · 0.95
getMessageMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected