(String filename)
| 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); |
no test coverage detected