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

8
LINES

< > BotCompany Repo | #1035372 // reversedByteBuffer

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

Libraryless. Click here for Pure Java version (8280L/46K).

static ByteBuffer reversedByteBuffer(ByteBuffer buf) {
  if (buf == null) null;
  int n = buf.size();
  byte[] data = buf.data, newData = new byte[n];
  for i to n:
    newData[i] = data[n-1-i];
  ret new ByteBuffer(newData);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035372
Snippet name: reversedByteBuffer
Eternal ID of this version: #1035372/2
Text MD5: 23398d539eb205479351380776642649
Transpilation MD5: 235f568c4b9566403963a4ef3276de71
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-03 13:05:29
Source code size: 234 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 109 / 158
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)