(File file)
| 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. |
no test coverage detected