1 package alt.java.io; 2 3 import java.io.*; 4 5 public class IOFactoryImpl implements IOFactory { 6 public InputStream createInputStream(File aFile) throws FileNotFoundException { 7 return new FileInputStream(aFile.getRealFile()); 8 } 9 10 public OutputStream createOutputStream(File aFile) throws FileNotFoundException { 11 return new FileOutputStream(aFile.getRealFile()); 12 } 13 14 public File createFile(String fileName) { 15 return new FileImpl(fileName); 16 } 17 } 18 | Popular Tags |