私が使う
try {
DataOutputStream out = c.openDataOutputStream();
String text = file + " | " + tag + " | " + report + " \n ";
out.write(text.getBytes());
out.close();
} catch (Exception e) {
System.out.println("IOException OutputStream: "+e.getMessage());
}`
ただし、ファイル内の既存のデータはすべて削除されます。