Libraryless. Click here for Pure Java version (36L/1K).
1 | static L wrapPrimitiveArrayAsImmutableList(O array) { |
2 | int n = Array.getLength(array); |
3 | ret new RandomAccessAbstractList() { |
4 | public int size() { ret n; } |
5 | public O get(int i) { ret Array.get(array, i); } |
6 | }; |
7 | } |
Began life as a copy of #1028512
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033085 |
Snippet name: | wrapPrimitiveArrayAsImmutableList - uses reflection |
Eternal ID of this version: | #1033085/2 |
Text MD5: | 5ba437a761ca4d6ee8d9cb36eae8fe85 |
Transpilation MD5: | e05496354e9ad26325bfc1a4682f9d00 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-14 02:53:51 |
Source code size: | 225 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 221 / 326 |
Version history: | 1 change(s) |
Referenced in: | [show references] |