Fix ClassLoader.getResourceAsStream

This commit is contained in:
Alexey Andreev 2017-12-03 13:08:08 +03:00
parent 0419867497
commit 8256302c03

View File

@ -50,11 +50,14 @@ public abstract class TClassLoader extends TObject {
}
JSObject data = resources.getResource(name);
String dataString = resourceToString(data);
if (dataString == null) {
return null;
}
byte[] bytes = new byte[dataString.length()];
for (int i = 0; i < bytes.length; ++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) {