liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package framework.util;
 
import java.io.File;
import java.io.FileInputStream;
 
public class FileUtil {
        
    public static byte[] getFileContent(File file) throws Throwable {
        FileInputStream fis = null;
        byte[] b = new byte[0];
        try{
            fis = new FileInputStream(file);
            int fsize = fis.available();
            b = new byte[fsize];
            fis.read(b);
        }catch(Exception e){
            throw e;
        }finally{
            try{
                fis.close();
            }catch(Exception e){
                
            }
        }
 
        return b;
    }
}