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

11
LINES

< > BotCompany Repo | #1033454 // isNonEmptySingleZip_byMagicHeader

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4728L/26K).

scope isNonEmptySingleZip_byMagicHeader.

static byte[] header = bytesFromHex("504B0304");

static bool isNonEmptySingleZip_byMagicHeader(byte[] data) {
  ret byteArrayStartsWith(data, header);
}

static bool isNonEmptySingleZip_byMagicHeader(File f) {
  ret isNonEmptySingleZip_byMagicHeader(loadBeginningOfBinaryFile(f, l(header)));
}

Author comment

Began life as a copy of #1009031

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033454
Snippet name: isNonEmptySingleZip_byMagicHeader
Eternal ID of this version: #1033454/1
Text MD5: 910fc614fcee9f00c2453e0861a0e4ef
Transpilation MD5: 41aad1900005e94087013788892d342e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-28 18:36:59
Source code size: 346 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 168 / 235
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)