MCPcopy Create free account
hub / github.com/TigerVNC/tigervnc / fromFile

Method fromFile

java/com/jcraft/jsch/Util.java:505–525  ·  view source on GitHub ↗
(String _file)

Source from the content-addressed store, hash-verified

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}

Callers 1

loadMethod · 0.95

Calls 4

checkTildeMethod · 0.95
readMethod · 0.65
closeMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected