Java Utililty Methods OutputStreamWriter Write

List of utility methods to do OutputStreamWriter Write

Description

The list of methods to do OutputStreamWriter Write are organized into topic(s).

Method

voidsaveTxt(OutputStream os, List list)
save Txt
try {
    OutputStreamWriter fw = newOutputStreamWriter(os);
    BufferedWriter bw = new BufferedWriter(fw);
    for (T element : list) {
        bw.write(element + "\n");
    bw.flush();
    bw.close();
...
voidsaveUnicodeStringToFile(final String string, final File file)
Save unicode string to file.
final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF8"));
bw.write(string);
bw.flush();
bw.close();
voidsaveUtfFileWithBOM(File file, String content)
save Utf File With BOM
BufferedWriter bw = null;
OutputStreamWriter osw = null;
FileOutputStream fos = new FileOutputStream(file);
try {
    if (file.length() < 1) {
        final byte[] bom = new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF };
        fos.write(bom);
    osw = new OutputStreamWriter(fos, "UTF-8");
    bw = new BufferedWriter(osw);
    if (content != null) {
        bw.write(content);
} catch (IOException ex) {
    throw ex;
} finally {
    try {
        bw.close();
        fos.close();
    } catch (Exception ex) {