static byte[] isJPEG_magic = bytesFromHex("FFD8FF"); static bool isJPEG(byte[] data) { ret byteArrayStartsWith(data, isJPEG_magic); } static bool isJPEG(File f) { ret isJPEG(loadBeginningOfBinaryFile(f, l(isJPEG_magic))); }
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: | 820 / 896 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |