【 解 説 】
前項とは逆の、byte[]をファイルに書き出す方法です。
【 例 文 】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
public static void write(byte[] b) { BufferedOutputStream stream = null; try { File file = new File("after.bin"); FileOutputStream fstream = new FileOutputStream(file); stream = new BufferedOutputStream(fstream); stream.write(b); } catch (IOException e) { e.printStackTrace(); } finally { if (stream != null) { try { stream.close(); } catch (IOException e1) { e1.printStackTrace(); } } } } |
■お薦め参考関連資料
Sun、Sun Microsystems、サンのロゴマーク、Java、Solarisに関連するすべての商標およびロゴマークは、米国 Sun Microsystems, Inc. の米国およびその他の国における商標または登録商標です。