Libraryless. Click here for Pure Java version (4579L/26K).
1 | static InputStream inputStreamForClass_forURLClassLoader(Class c) ctex { |
2 | if (c == null) null; |
3 | ClassLoader cl = getClassLoader(c); |
4 | |
5 | if (cl cast URLClassLoader) { |
6 | S name = c.getName().replace('.', '/') + ".class"; |
7 | var urls = cl.getURLs(); |
8 | for (URL url : urls) pcall { |
9 | File location = urlToFile(url); |
10 | try object InputStream in = inputStreamForFileInDirOrZip(location, name); |
11 | } |
12 | fail(name + " not found in: " + urls); |
13 | } |
14 | |
15 | null; |
16 | } |
Began life as a copy of #1012231
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033452 |
Snippet name: | inputStreamForClass_forURLClassLoader |
Eternal ID of this version: | #1033452/3 |
Text MD5: | 67cb27dcf2e714745c8c9ccbc84ec2ab |
Transpilation MD5: | dd14250a70c167bc9f2aab0c67435252 |
Author: | stefan |
Category: | javax / byte code |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-28 18:32:57 |
Source code size: | 484 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 208 / 280 |
Version history: | 2 change(s) |
Referenced in: | [show references] |