MCPcopy Create free account
hub / github.com/Drun1baby/JavaSecurityLearning / getBytes

Method getBytes

JavaSecurity/AesEncode.java:20–30  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

18
19
20 public static byte[] getBytes(String path) throws Exception{
21 InputStream inputStream = new FileInputStream(path);
22 ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
23 int n = 0;
24 while ((n=inputStream.read())!=-1){
25 byteArrayOutputStream.write(n);
26 }
27 byte[] bytes = byteArrayOutputStream.toByteArray();
28 return bytes;
29
30 }
31}

Callers 1

mainMethod · 0.95

Calls 2

readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected