Ich habe ein Programm, welches mir zwei Textdataien erstellt (shot_distribution.INC und interaction.INC). Mein Problem ist, dass der Text, der in "interaction.INC" gespeichert wird, noch zusätzlich in der Datei "shot_distribution.INC" steht. Wie schaffe ich es, dass der Text aus "interaction.INC" nicht mehr in der Datei "shot_distribution.INC" gespeichert wird sondern nur in "interaction.INC"?
Code:
...
public class vollstaendigeBestrahlung extends PrintStream{
PrintStream konsole = System.out;
public vollstaendigeBestrahlung(String logfileName) throws IOException {
super(new FileOutputStream(logfileName));
}
public void write(byte[] buf, int off, int len) {
konsole.write(buf, off, len);
super.write(buf, off, len);
}
public static void main (String[] args) throws IOException{
...
//Konsolenausgabe in der Datei "shot_distribution.INC" speichern
PrintStream tee = new vollstaendigeBestrahlung("shot_distribution.INC");
System.setOut(tee);
System.out.println("************************************************************");
System.out.println("**Überdeckungsgrad Ü = "+ue*100+"%");
System.out.println("************************************************************");
...
//Konsolenausgabe in der Datei "interaction.INC" speichern
PrintStream teee = new vollstaendigeBestrahlung("interaction.INC");
System.setOut(teee);
//Interaction Erzeugung
System.out.println("************************************************************");
System.out.println("**Interaction Erzeugung");
System.out.println("************************************************************");
for (int i=0; i<anzahl;i++){
System.out.println("*SURFACE INTERACTION, NAME =Int"+i);
System.out.println("*FRICTION");
System.out.println("0.4");
System.out.println("*CONTACT PAIR, INTERACTION =Int"+i);
System.out.println("TrefferFlaeche,AS"+i);
}
}}