JMemo023

private static byte[] readFile(String path) {
    long size = new File(path).length();
    byte[] b = new byte[(int)size];
    FileInputStream fis = null;
    try {
        fis = new FileInputStream(path);
        fis.read(b, 0, (int)size);
        } catch (FileNotFoundException e) {
        e.printStackTrace();    
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        try {
            fis.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return b;
}

戻る

最終更新:2012年06月07日 18:19