1 26 27 package org.objectweb.benchmark.util; 28 29 import java.io.File ; 31 import java.io.FileOutputStream ; 32 import java.io.IOException ; 33 import java.io.PrintStream ; 34 35 36 43 public class ResultPrinter 44 { 45 51 52 private PrintStream file = null; 53 54 60 65 public ResultPrinter(String filename) 66 { 67 file = openFile( new File (filename) ); 68 } 69 70 76 83 private PrintStream 84 openFile(File f) 85 { 86 FileOutputStream fos = null; 87 88 try 89 { 90 f.createNewFile(); 92 fos = new FileOutputStream (f, true); 94 } catch (IOException e) { 95 e.printStackTrace(); 96 } 97 98 return new PrintStream (fos); 99 } 100 101 107 112 public void write(long l) 113 { 114 file.println(l); 115 } 116 117 120 public void close() 121 { 122 file.close(); 123 } 124 125 } 126 | Popular Tags |