KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > archive > io > FileReader


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.archive.io;
8
9 import java.io.File JavaDoc;
10 import java.io.FileInputStream JavaDoc;
11 import java.util.zip.ZipInputStream JavaDoc;
12
13
14 /**
15  * Reader implementation based on a File. The file is transformed into a stream.
16  *
17  * @author Laurent Etiemble
18  * @version $Revision: 1.2 $
19  */

20 public class FileReader extends StreamReader
21 {
22    /**
23     * Builds a FileReader on a File
24     *
25     * @param file The File to read
26     */

27    public FileReader(File JavaDoc file)
28    {
29       try
30       {
31          FileInputStream JavaDoc fis = new FileInputStream JavaDoc(file);
32          this.pushZipInputStream(new ZipInputStream JavaDoc(fis));
33       }
34       catch (Exception JavaDoc ioe)
35       {
36          ioe.printStackTrace();
37       }
38    }
39 }
40
Popular Tags