Libraryless. Click here for Pure Java version (8280L/46K).
1 | static ByteBuffer reversedByteBuffer(ByteBuffer buf) { |
2 | if (buf == null) null; |
3 | int n = buf.size(); |
4 | byte[] data = buf.data, newData = new byte[n]; |
5 | for i to n: |
6 | newData[i] = data[n-1-i]; |
7 | ret new ByteBuffer(newData); |
8 | } |
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: | 110 / 161 |
Version history: | 1 change(s) |
Referenced in: | [show references] |