Java PrintWriter Write saveStringBufferTofile(String fileName, StringBuffer sb)

Here you can find the source of saveStringBufferTofile(String fileName, StringBuffer sb)

Description

save String Buffer Tofile

License

Open Source License

Declaration

public static void saveStringBufferTofile(String fileName,
            StringBuffer sb) throws FileNotFoundException,
            UnsupportedEncodingException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static void saveStringBufferTofile(String fileName,
            StringBuffer sb) throws FileNotFoundException,
            UnsupportedEncodingException {
        PrintWriter writer = new PrintWriter(fileName, "UTF-8");
        try {//from  w  w  w. j a  v a  2  s . co m
            writer.println(sb);
            writer.close();
        } finally {
            writer.close();
        }
    }
}

Related

  1. saveProcessedDataFile(double[][] data, String file)
  2. saveSet(Set set, File setFile, String encoding)
  3. saveSortedMap(Map map, File mapFile, String separator, String qualifier, String encoding)
  4. saveString(String theFilePath, String theString)
  5. saveStringAsFile(String string, String path)
  6. saveStrings(final String filename, final String[] sArray)
  7. saveStrings(String filename, String data[])
  8. saveStrings(String theFilePath, String[] theStrings)
  9. saveStringToFile(String text, String path)