(String _file)
| 503 | } |
| 504 | |
| 505 | static byte[] fromFile(String _file) throws IOException { |
| 506 | _file = checkTilde(_file); |
| 507 | File file = new File(_file); |
| 508 | FileInputStream fis = new FileInputStream(_file); |
| 509 | try { |
| 510 | byte[] result = new byte[(int)(file.length())]; |
| 511 | int len=0; |
| 512 | while(true){ |
| 513 | int i=fis.read(result, len, result.length-len); |
| 514 | if(i<=0) |
| 515 | break; |
| 516 | len+=i; |
| 517 | } |
| 518 | fis.close(); |
| 519 | return result; |
| 520 | } |
| 521 | finally { |
| 522 | if(fis!=null) |
| 523 | fis.close(); |
| 524 | } |
| 525 | } |
| 526 | } |
no test coverage detected