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

11
LINES

< > BotCompany Repo | #1024738 // concatByteArrays (allows null arrays)

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

Libraryless. Click here for Pure Java version (1654L/11K).

static byte[] concatByteArrays(byte[]... arrays) {
  int l = 0;
  for (byte[] a : arrays) l += l(a);
  byte[] x = new byte[l];
  int i = 0;
  for (byte[] a : arrays) if (a != null) {
    System.arraycopy(a, 0, x, i, l(a));
    i += l(a);
  }
  ret x;
}

Author comment

Began life as a copy of #1003113

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024738
Snippet name: concatByteArrays (allows null arrays)
Eternal ID of this version: #1024738/2
Text MD5: 5c15966b7a91bf7b11c80aff1db8a042
Transpilation MD5: 1a4b2641be7800c915a230d183bcbab4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 15:41:21
Source code size: 264 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 125 / 180
Version history: 1 change(s)
Referenced in: [show references]