MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / readfile

Method readfile

src/main/java/core/packetproxy/common/Utils.java:209–221  ·  view source on GitHub ↗
(String filename)

Source from the content-addressed store, hash-verified

207 }
208
209 public static byte[] readfile(String filename) throws Exception {
210 FileInputStream fis = new FileInputStream(filename);
211 BufferedInputStream bis = new BufferedInputStream(fis);
212 ByteArrayOutputStream bout = new ByteArrayOutputStream();
213 byte[] buffer = new byte[4096];
214 int len = 0;
215 while ((len = bis.read(buffer, 0, 4096)) > 0) {
216
217 bout.write(buffer, 0, len);
218 }
219 fis.close();
220 return bout.toByteArray();
221 }
222
223 public static void deletefile(String filename) throws Exception {
224 File file = new File(filename);

Callers 4

importPEMMethod · 0.95
importDERMethod · 0.95
mouseClickedMethod · 0.95
actionPerformedMethod · 0.95

Calls 4

writeMethod · 0.65
readMethod · 0.45
closeMethod · 0.45
toByteArrayMethod · 0.45

Tested by

no test coverage detected