List of utility methods to do File Write
void | writeContatctInfo(String accountId, Vector contactInfo, File contactInfoFile) write Contatct Info contactInfoFile.getParentFile().mkdirs(); FileOutputStream contactFileOutputStream = new FileOutputStream( contactInfoFile); DataOutputStream out = new DataOutputStream(contactFileOutputStream); out.writeUTF((String) contactInfo.get(0)); out.writeInt(((Integer) (contactInfo.get(1))).intValue()); for (int i = 2; i < contactInfo.size(); ++i) { out.writeUTF((String) contactInfo.get(i)); ... |
void | writeFile(File file, String data) write File FileWriter fstream = new FileWriter(file); BufferedWriter out = new BufferedWriter(fstream); out.write(data); out.close(); |
void | writeFile(File file, byte[] data) write File DataOutputStream out = null; if (null != file && null != data) { try { out = new DataOutputStream(new FileOutputStream(file)); out.write(data); } finally { if (out != null) { out.close(); ... |
void | writeInstallationFile(File installation) write Installation File FileOutputStream out = new FileOutputStream(installation);
String id = UUID.randomUUID().toString();
out.write(id.getBytes());
out.close();
|
boolean | writeOneLine(String filename, String value) write One Line FileWriter fileWriter = null; try { fileWriter = new FileWriter(filename); fileWriter.write(value); } catch (IOException e) { String Error = "Error writing { " + value + " } to file: " + filename; Log.e(TAG, Error, e); ... |
void | stringToFile(String filename, String stringToWrite) Saves passed string to file try { BufferedWriter writer = new BufferedWriter(new FileWriter( filename)); writer.write(stringToWrite); writer.flush(); writer.close(); } catch (Exception ignored) { |