KickJava   Java API By Example, From Geeks To Geeks.

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


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.ByteArrayInputStream JavaDoc;
10 import java.util.zip.ZipInputStream JavaDoc;
11
12
13 /**
14  * Reader implementation based on a byte array. The stream is build onto the byte array.
15  *
16  * @author Laurent Etiemble
17  * @version $Revision: 1.2 $
18  */

19 public class ByteReader extends StreamReader
20 {
21    /**
22     * Builds a ByteReader on a byte array
23     *
24     * @param content Description of the Parameter
25     */

26    public ByteReader(byte[] content)
27    {
28       try
29       {
30          ByteArrayInputStream JavaDoc bais = new ByteArrayInputStream JavaDoc(content);
31          this.pushZipInputStream(new ZipInputStream JavaDoc(bais));
32       }
33       catch (Exception JavaDoc ioe)
34       {
35          ioe.printStackTrace();
36       }
37    }
38 }
39
Popular Tags