Using OutputStreamWriter:
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.OutputStreamWriter;
- import java.io.BufferedWriter;
- public class WriteByOutputStreamWriterExe {
- public static void main(String[] args) throws Exception {
- File file = new File("D:\\data1.txt");
- FileOutputStream fileStream = new FileOutputStream(file);
- OutputStreamWriter outputStream = new OutputStreamWriter(fileStream);
- BufferedWriter bw = new BufferedWriter(outputStream);
- for (int i = 0; i < 5; i++) {
- bw.write("Using FileOutputStream. Isn't is interesting !! :)");
- bw.newLine();
- }
- bw.close();
- }
- }
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
Using FileOutputStream. Isn't is interesting !! :)
No comments:
Post a Comment