summaryrefslogtreecommitdiff
path: root/gi/posterior-regularisation/prjava/src/io/FileUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'gi/posterior-regularisation/prjava/src/io/FileUtil.java')
-rw-r--r--gi/posterior-regularisation/prjava/src/io/FileUtil.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/gi/posterior-regularisation/prjava/src/io/FileUtil.java b/gi/posterior-regularisation/prjava/src/io/FileUtil.java
new file mode 100644
index 00000000..bfa58213
--- /dev/null
+++ b/gi/posterior-regularisation/prjava/src/io/FileUtil.java
@@ -0,0 +1,37 @@
+package io;
+import java.util.*;
+import java.io.*;
+public class FileUtil {
+ public static Scanner openInFile(String filename){
+ Scanner localsc=null;
+ try
+ {
+ localsc=new Scanner (new FileInputStream(filename));
+
+ }catch(IOException ioe){
+ System.out.println(ioe.getMessage());
+ }
+ return localsc;
+ }
+ public static PrintStream openOutFile(String filename){
+ PrintStream localps=null;
+ try
+ {
+ localps=new PrintStream (new FileOutputStream(filename));
+
+ }catch(IOException ioe){
+ System.out.println(ioe.getMessage());
+ }
+ return localps;
+ }
+ public static FileInputStream openInputStream(String infilename){
+ FileInputStream fis=null;
+ try {
+ fis =(new FileInputStream(infilename));
+
+ } catch (IOException ioe) {
+ System.out.println(ioe.getMessage());
+ }
+ return fis;
+ }
+}