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

13
LINES

< > BotCompany Repo | #1029524 // readCompressed30BitUint - see compress30BitUint

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

Libraryless. Click here for Pure Java version (2509L/16K).

static int readCompressed30BitUint(IF0_Byte readByte) {
  int i = ubyteToInt(readByte!);
  if (i < 0x40) ret i;
  if (i < 0x80)
    ret ((i & 0x3F) << 8) | ubyteToInt(readByte!);
  int j = ubyteToInt(readByte!);
  if (i < 0xC0)
    ret ((i & 0x3F) << 16)
      | (j << 8) | ubyteToInt(readByte!);
  int k = ubyteToInt(readByte!);
    ret ((i & 0x3F) << 24)
      | (j << 16) | (k << 8) | ubyteToInt(readByte!);
}

Author comment

Began life as a copy of #1029522

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029524
Snippet name: readCompressed30BitUint - see compress30BitUint
Eternal ID of this version: #1029524/3
Text MD5: 7e318c02b998ddd9829dbbec5f272a7b
Transpilation MD5: bc33038d18af6655cd7dc6689fc1c389
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-17 16:52:29
Source code size: 424 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 186 / 281
Version history: 2 change(s)
Referenced in: [show references]