Java Filewrite

java-filewrite.png

バイナリデータを一気に書き込む

File file=new File("data.bin");
int size=5;
byte[] buf={'1','2','3','4','5'};
BufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(file));
outStream.write(buf, 0, size);
outStream.close();

サポートサイト Wikidot.com