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

9
LINES

< > BotCompany Repo | #1009031 // isJPEG - tests using magic bytes

JavaX fragment (include)

1  
static byte[] isJPEG_magic = bytesFromHex("FFD8FF");
2  
3  
static bool isJPEG(byte[] data) {
4  
  ret byteArrayStartsWith(data, isJPEG_magic);
5  
}
6  
7  
static bool isJPEG(File f) {
8  
  ret isJPEG(loadBeginningOfBinaryFile(f, l(isJPEG_magic)));
9  
}

Author comment

Began life as a copy of #1004676

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009031
Snippet name: isJPEG - tests using magic bytes
Eternal ID of this version: #1009031/4
Text MD5: b0d2164db37bc5af9c01c1850a8092f3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-15 20:41:18
Source code size: 237 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 589 / 647
Version history: 3 change(s)
Referenced in: [show references]