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

6
LINES

< > BotCompany Repo | #1023056 // resizeByteArray

JavaX fragment (include)

1  
static byte[] resizeByteArray(byte[] a, int n) {
2  
  if (n == l(a)) ret a;
3  
  byte[] b = new byte[n];
4  
  arraycopy(a, 0, b, 0, min(l(a), n));
5  
  ret b;
6  
}

Author comment

Began life as a copy of #1006736

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023056
Snippet name: resizeByteArray
Eternal ID of this version: #1023056/2
Text MD5: 15fa7c474c3a85273b80a29ca4fc2744
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-29 23:16:20
Source code size: 153 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 300 / 349
Version history: 1 change(s)
Referenced in: [show references]