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

7
LINES

< > BotCompany Repo | #1033117 // intToBytes_inList_littleEndian_partial

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

Libraryless. Click here for Pure Java version (3860L/22K).

svoid intToBytes_inList_littleEndian_partial(int i, L<Byte> l, int idx) {
  int n = l(l);
  if (idx < n) l.set(idx, (byte) i);
  if (idx+1 < n) l.set(idx+1, (byte) (i >>> 8));
  if (idx+2 < n) l.set(idx+2, (byte) (i >>> 16));
  if (idx+3 < n) l.set(idx+3, (byte) (i >>> 24));
}

Author comment

Began life as a copy of #1031654

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033117
Snippet name: intToBytes_inList_littleEndian_partial
Eternal ID of this version: #1033117/1
Text MD5: 3ab7e3aba3845b1bf617f96bfcde0950
Transpilation MD5: 4cc962ddfa4ec9e435c78c98edfd49ae
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-15 15:40:47
Source code size: 283 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 84 / 126
Referenced in: [show references]