KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > connextra > util > RealReaderFactory


1 package com.connextra.util;
2
3 import java.io.*;
4 import java.net.*;
5
6
7 public class RealReaderFactory implements ReaderFactory {
8     public Reader create(File aFile) throws IOException {
9         return new FileReader(aFile);
10     }
11
12     public Reader create(InputStream anInputStream) {
13         return new InputStreamReader(anInputStream);
14     }
15
16     public BufferedReader create(URL aURL) throws IOException {
17         return new BufferedReader(new InputStreamReader(aURL.openStream()));
18     }
19 }
Popular Tags