MCPcopy Create free account
hub / github.com/HumbleUI/Skija / readResource

Method readResource

shared/java/impl/Library.java:23–35  ·  view source on GitHub ↗
(URL url)

Source from the content-addressed store, hash-verified

21 }
22
23 public static String readResource(URL url) {
24 try (Reader reader = new InputStreamReader(url.openStream(), StandardCharsets.UTF_8)) {
25 StringBuilder builder = new StringBuilder();
26
27 int ch;
28 while ((ch = reader.read()) >= 0) {
29 builder.append((char) ch);
30 }
31 return builder.toString().trim();
32 } catch (IOException e) {
33 return null;
34 }
35 }
36
37 @SneakyThrows
38 public static synchronized void load() {

Callers 1

loadMethod · 0.95

Calls 4

openStreamMethod · 0.80
readMethod · 0.80
appendMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected