write to file in ansi
807597Sep 13 2005 — edited Sep 14 2005I want to write an arraylist to a text file and have the file encoded in ansi. I have found the only way to have the file encoded in ansi is to write strings to the file. I can't figure out how to cast my arraylist to strings, (which is what i think I must do).
Any help/suggestions are appreciated. Below is my code:
import java.io.*;
//This class writes the status to the Master.txt file upon radio button press
class Writer1{
public Writer1(){
System.out.println("writer1 has been called");
try {
OutputStream bout = new BufferedOutputStream(fout);
OutputStreamWriter out = new OutputStreamWriter(bout,"ASCII");
for(int i = 0; i < Chat6.arrList.size(); i++) {
//out.write(Chat6.arrList.get(i)) + "\n");//need to convert to string
}
System.out.println("writing array loop " +Chat6.arrList);
out.flush();
out.close();
} catch (IOException e) {
}
}
}