01: // ZipInputStream.java
02: // $Id: ZipInputStream.java,v 1.2 2000/08/16 21:37:48 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1998.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05: package org.w3c.jigsaw.zip;
06:
07: import java.io.IOException;
08: import java.io.InputStream;
09:
10: import java.util.zip.ZipFile;
11:
12: /**
13: * @version $Revision: 1.2 $
14: * @author Benoît Mahé (bmahe@w3.org)
15: */
16: public class ZipInputStream extends InputStream {
17:
18: private InputStream in;
19: private ZipFile zip;
20:
21: public int available() throws IOException {
22: return in.available();
23: }
24:
25: public void close() throws IOException {
26: try {
27: in.close();
28: } finally {
29: zip.close();
30: }
31: }
32:
33: public synchronized void mark(int readlimit) {
34: in.mark(readlimit);
35: }
36:
37: public synchronized void reset() throws IOException {
38: in.reset();
39: }
40:
41: public boolean markSupported() {
42: return in.markSupported();
43: }
44:
45: public int read() throws IOException {
46: return in.read();
47: }
48:
49: public int read(byte b[]) throws IOException {
50: return in.read(b);
51: }
52:
53: public int read(byte b[], int off, int len) throws IOException {
54: return in.read(b, off, len);
55: }
56:
57: public long skip(long n) throws IOException {
58: return in.skip(n);
59: }
60:
61: protected ZipInputStream(ZipFile zip, InputStream in) {
62: this.zip = zip;
63: this.in = in;
64: }
65: }
|