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

4
LINES

< > BotCompany Repo | #1033138 // replaceByteInInt_littleEndian

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

Libraryless. Click here for Pure Java version (29L/1K).

static int replaceByteInInt_littleEndian(int i, int byteNr, int theByte) {
  int mask = 255 << (byteNr*8);
  ret (i & ~mask) | (theByte << (byteNr*8)) & mask;
}

Author comment

Began life as a copy of #1033137

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033138
Snippet name: replaceByteInInt_littleEndian
Eternal ID of this version: #1033138/1
Text MD5: ac647e6dcdb7a5cc4d40fdb29354448b
Transpilation MD5: 7e0fa92a29d1ef37bc7677b7f2184fd4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-15 17:38:36
Source code size: 163 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 139 / 199
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)