- Timestamp:
- 05/17/11 15:40:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/ReplayGenerator.java
r1 r44 2 2 3 3 import java.io.File; 4 import java.io.File Writer;4 import java.io.FileOutputStream; 5 5 import java.io.IOException; 6 import java.io.OutputStreamWriter; 6 7 import java.util.List; 7 8 … … 14 15 15 16 public void createLogfileMultipleSessions(List<List<ReplayableEvent<?>>> sequences, String filename) { 16 FileWriter writer = openReplayFile(filename);17 OutputStreamWriter writer = openReplayFile(filename); 17 18 if( writer!=null ) { 18 19 try { 19 writer.write("<?xml version=\"1.0\" encoding=\"UTF- 8\"?>" + StringTools.ENDLINE);20 writer.write("<?xml version=\"1.0\" encoding=\"UTF-16\"?>" + StringTools.ENDLINE); 20 21 writer.write("<log>" + StringTools.ENDLINE); 21 22 … … 33 34 34 35 public void createLogfileSingleSession(List<ReplayableEvent<?>> actions, String filename) { 35 FileWriter writer = openReplayFile(filename);36 OutputStreamWriter writer = openReplayFile(filename); 36 37 if( writer!=null ) { 37 38 try { 38 writer.write("<?xml version=\"1.0\" encoding=\"UTF- 8\"?>" + StringTools.ENDLINE);39 writer.write("<?xml version=\"1.0\" encoding=\"UTF-16\"?>" + StringTools.ENDLINE); 39 40 writer.write("<log>" + StringTools.ENDLINE); 40 41 … … 49 50 } 50 51 51 private FileWriter openReplayFile(String filename) {52 private OutputStreamWriter openReplayFile(String filename) { 52 53 File file = new File(filename); 53 54 boolean fileCreated; … … 63 64 Console.printStacktrace(e); 64 65 } 65 FileWriter writer = null;66 OutputStreamWriter writer = null; 66 67 try { 67 writer = new FileWriter(file);68 writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-16"); 68 69 } catch (IOException e) { 69 70 Console.printerrln("Unable to open file for writing (read-only file):" + filename); … … 73 74 } 74 75 75 private void writeSession(List<ReplayableEvent<?>> actions, FileWriter writer)76 private void writeSession(List<ReplayableEvent<?>> actions, OutputStreamWriter writer) 76 77 throws IOException { 77 78 writer.write(" <session>" + StringTools.ENDLINE);
Note: See TracChangeset
for help on using the changeset viewer.