Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1015994 - isGIF

JavaX fragment (include)

static byte[] isGIF_magic = bytesFromHex("47494638"); // Actual signature is longer, but we're lazy

static bool isGIF(byte[] data) {
  ret byteArrayStartsWith(data, isGIF_magic);
}

static bool isGIF(File f) {
  ret isGIF(loadBeginningOfBinaryFile(f, l(isGIF_magic)));
}

Author comment

Began life as a copy of #1009031

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1015994
Snippet name: isGIF
Eternal ID of this version: #1015994/3
Text MD5: b6750b1cc3b131dd92b41bde82a3d889
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-02 20:32:11
Source code size: 279 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 186 / 191
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1015994 & http://1015994.tinybrain.de