mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-08 07:54:11 -08:00
Fix ClassLoader.getResourceAsStream
This commit is contained in:
parent
0419867497
commit
8256302c03
|
@ -50,11 +50,14 @@ public abstract class TClassLoader extends TObject {
|
||||||
}
|
}
|
||||||
JSObject data = resources.getResource(name);
|
JSObject data = resources.getResource(name);
|
||||||
String dataString = resourceToString(data);
|
String dataString = resourceToString(data);
|
||||||
|
if (dataString == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
byte[] bytes = new byte[dataString.length()];
|
byte[] bytes = new byte[dataString.length()];
|
||||||
for (int i = 0; i < bytes.length; ++i) {
|
for (int i = 0; i < bytes.length; ++i) {
|
||||||
bytes[i] = (byte) dataString.charAt(i);
|
bytes[i] = (byte) dataString.charAt(i);
|
||||||
}
|
}
|
||||||
return dataString == null ? null : new ByteArrayInputStream(Base64Impl.decode(bytes));
|
return new ByteArrayInputStream(Base64Impl.decode(bytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InputStream getSystemResourceAsStream(String name) {
|
public static InputStream getSystemResourceAsStream(String name) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user