MCPcopy Create free account
hub / github.com/ReadyTalk/avian / read

Method read

test/DefineClass.java:22–33  ·  view source on GitHub ↗
(File file)

Source from the content-addressed store, hash-verified

20 }
21
22 private static byte[] read(File file) throws IOException {
23 byte[] bytes = new byte[(int) file.length()];
24 FileInputStream in = new FileInputStream(file);
25 try {
26 if (in.read(bytes) != (int) file.length()) {
27 throw new RuntimeException();
28 }
29 return bytes;
30 } finally {
31 in.close();
32 }
33 }
34
35 private static Class loadClass(String name) throws Exception {
36 return new MyClassLoader(DefineClass.class.getClassLoader()).defineClass

Callers 1

loadClassMethod · 0.95

Calls 3

readMethod · 0.95
closeMethod · 0.95
lengthMethod · 0.65

Tested by

no test coverage detected