• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 only, as
8  * published by the Free Software Foundation.  Oracle designates this
9  * particular file as subject to the "Classpath" exception as provided
10  * by Oracle in the LICENSE file that accompanied this code.
11  *
12  * This code is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * version 2 for more details (a copy is included in the LICENSE file that
16  * accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License version
19  * 2 along with this work; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23  * or visit www.oracle.com if you need additional information or have any
24  * questions.
25  */
26 
27 package java.util.zip;
28 
29 import android.compat.annotation.UnsupportedAppUsage;
30 
31 @SuppressWarnings({"unchecked", "deprecation", "all"})
32 public class ZipFile implements java.util.zip.ZipConstants, java.io.Closeable {
33 
ZipFile(java.lang.String name)34     public ZipFile(java.lang.String name) throws java.io.IOException {
35         throw new RuntimeException("Stub!");
36     }
37 
ZipFile(java.io.File file, int mode)38     public ZipFile(java.io.File file, int mode) throws java.io.IOException {
39         throw new RuntimeException("Stub!");
40     }
41 
ZipFile(java.io.File file)42     public ZipFile(java.io.File file) throws java.io.IOException, java.util.zip.ZipException {
43         throw new RuntimeException("Stub!");
44     }
45 
ZipFile(java.io.File file, int mode, java.nio.charset.Charset charset)46     public ZipFile(java.io.File file, int mode, java.nio.charset.Charset charset)
47             throws java.io.IOException {
48         throw new RuntimeException("Stub!");
49     }
50 
ZipFile(java.lang.String name, java.nio.charset.Charset charset)51     public ZipFile(java.lang.String name, java.nio.charset.Charset charset)
52             throws java.io.IOException {
53         throw new RuntimeException("Stub!");
54     }
55 
ZipFile(java.io.File file, java.nio.charset.Charset charset)56     public ZipFile(java.io.File file, java.nio.charset.Charset charset) throws java.io.IOException {
57         throw new RuntimeException("Stub!");
58     }
59 
getComment()60     public java.lang.String getComment() {
61         throw new RuntimeException("Stub!");
62     }
63 
getEntry(java.lang.String name)64     public java.util.zip.ZipEntry getEntry(java.lang.String name) {
65         throw new RuntimeException("Stub!");
66     }
67 
68     @UnsupportedAppUsage
getEntry(long jzfile, byte[] name, boolean addSlash)69     private static native long getEntry(long jzfile, byte[] name, boolean addSlash);
70 
freeEntry(long jzfile, long jzentry)71     private static native void freeEntry(long jzfile, long jzentry);
72 
getInputStream(java.util.zip.ZipEntry entry)73     public java.io.InputStream getInputStream(java.util.zip.ZipEntry entry)
74             throws java.io.IOException {
75         throw new RuntimeException("Stub!");
76     }
77 
getInflater()78     private java.util.zip.Inflater getInflater() {
79         throw new RuntimeException("Stub!");
80     }
81 
releaseInflater(java.util.zip.Inflater inf)82     private void releaseInflater(java.util.zip.Inflater inf) {
83         throw new RuntimeException("Stub!");
84     }
85 
getName()86     public java.lang.String getName() {
87         throw new RuntimeException("Stub!");
88     }
89 
entries()90     public java.util.Enumeration<? extends java.util.zip.ZipEntry> entries() {
91         throw new RuntimeException("Stub!");
92     }
93 
stream()94     public java.util.stream.Stream<? extends java.util.zip.ZipEntry> stream() {
95         throw new RuntimeException("Stub!");
96     }
97 
getZipEntry(java.lang.String name, long jzentry)98     private java.util.zip.ZipEntry getZipEntry(java.lang.String name, long jzentry) {
99         throw new RuntimeException("Stub!");
100     }
101 
getNextEntry(long jzfile, int i)102     private static native long getNextEntry(long jzfile, int i);
103 
size()104     public int size() {
105         throw new RuntimeException("Stub!");
106     }
107 
close()108     public void close() throws java.io.IOException {
109         throw new RuntimeException("Stub!");
110     }
111 
finalize()112     protected void finalize() throws java.io.IOException {
113         throw new RuntimeException("Stub!");
114     }
115 
116     @UnsupportedAppUsage
close(long jzfile)117     private static native void close(long jzfile);
118 
ensureOpen()119     private void ensureOpen() {
120         throw new RuntimeException("Stub!");
121     }
122 
ensureOpenOrZipException()123     private void ensureOpenOrZipException() throws java.io.IOException {
124         throw new RuntimeException("Stub!");
125     }
126 
startsWithLocHeader()127     public boolean startsWithLocHeader() {
128         throw new RuntimeException("Stub!");
129     }
130 
getFileDescriptor()131     public int getFileDescriptor() {
132         throw new RuntimeException("Stub!");
133     }
134 
getFileDescriptor(long jzfile)135     private static native int getFileDescriptor(long jzfile);
136 
open( java.lang.String name, int mode, long lastModified, boolean usemmap)137     private static native long open(
138             java.lang.String name, int mode, long lastModified, boolean usemmap)
139             throws java.io.IOException;
140 
getTotal(long jzfile)141     private static native int getTotal(long jzfile);
142 
startsWithLOC(long jzfile)143     private static native boolean startsWithLOC(long jzfile);
144 
read(long jzfile, long jzentry, long pos, byte[] b, int off, int len)145     private static native int read(long jzfile, long jzentry, long pos, byte[] b, int off, int len);
146 
getEntryTime(long jzentry)147     private static native long getEntryTime(long jzentry);
148 
getEntryCrc(long jzentry)149     private static native long getEntryCrc(long jzentry);
150 
getEntryCSize(long jzentry)151     private static native long getEntryCSize(long jzentry);
152 
getEntrySize(long jzentry)153     private static native long getEntrySize(long jzentry);
154 
getEntryMethod(long jzentry)155     private static native int getEntryMethod(long jzentry);
156 
getEntryFlag(long jzentry)157     private static native int getEntryFlag(long jzentry);
158 
getCommentBytes(long jzfile)159     private static native byte[] getCommentBytes(long jzfile);
160 
getEntryBytes(long jzentry, int type)161     private static native byte[] getEntryBytes(long jzentry, int type);
162 
getZipMessage(long jzfile)163     private static native java.lang.String getZipMessage(long jzfile);
164 
165     private static final int DEFLATED = 8; // 0x8
166 
167     private static final int JZENTRY_COMMENT = 2; // 0x2
168 
169     private static final int JZENTRY_EXTRA = 1; // 0x1
170 
171     private static final int JZENTRY_NAME = 0; // 0x0
172 
173     public static final int OPEN_DELETE = 4; // 0x4
174 
175     public static final int OPEN_READ = 1; // 0x1
176 
177     private static final int STORED = 0; // 0x0
178 
179     private volatile boolean closeRequested = false;
180 
181     private final java.io.File fileToRemoveOnClose;
182 
183     {
184         fileToRemoveOnClose = null;
185     }
186 
187     private final dalvik.system.CloseGuard guard;
188 
189     {
190         guard = null;
191     }
192 
193     private java.util.Deque<java.util.zip.Inflater> inflaterCache;
194 
195     @UnsupportedAppUsage
196     private long jzfile;
197 
198     private final boolean locsig;
199 
200     {
201         locsig = false;
202     }
203 
204     private final java.lang.String name;
205 
206     {
207         name = null;
208     }
209 
210     private final java.util.Map<java.io.InputStream, java.util.zip.Inflater> streams;
211 
212     {
213         streams = null;
214     }
215 
216     private final int total;
217 
218     {
219         total = 0;
220     }
221 
222     private static final boolean usemmap;
223 
224     static {
225         usemmap = false;
226     }
227 
228     private java.util.zip.ZipCoder zc;
229 
230     @SuppressWarnings({"unchecked", "deprecation", "all"})
231     private class ZipEntryIterator
232             implements java.util.Enumeration<java.util.zip.ZipEntry>,
233                     java.util.Iterator<java.util.zip.ZipEntry> {
234 
ZipEntryIterator()235         public ZipEntryIterator() {
236             throw new RuntimeException("Stub!");
237         }
238 
hasMoreElements()239         public boolean hasMoreElements() {
240             throw new RuntimeException("Stub!");
241         }
242 
hasNext()243         public boolean hasNext() {
244             throw new RuntimeException("Stub!");
245         }
246 
247         @UnsupportedAppUsage
nextElement()248         public java.util.zip.ZipEntry nextElement() {
249             throw new RuntimeException("Stub!");
250         }
251 
next()252         public java.util.zip.ZipEntry next() {
253             throw new RuntimeException("Stub!");
254         }
255 
256         private int i = 0; // 0x0
257     }
258 
259     @SuppressWarnings({"unchecked", "deprecation", "all"})
260     private class ZipFileInflaterInputStream extends java.util.zip.InflaterInputStream {
261 
ZipFileInflaterInputStream( java.util.zip.ZipFile.ZipFileInputStream zfin, java.util.zip.Inflater inf, int size)262         ZipFileInflaterInputStream(
263                 java.util.zip.ZipFile.ZipFileInputStream zfin,
264                 java.util.zip.Inflater inf,
265                 int size) {
266             super((java.io.InputStream) null);
267             throw new RuntimeException("Stub!");
268         }
269 
close()270         public void close() throws java.io.IOException {
271             throw new RuntimeException("Stub!");
272         }
273 
fill()274         protected void fill() throws java.io.IOException {
275             throw new RuntimeException("Stub!");
276         }
277 
available()278         public int available() throws java.io.IOException {
279             throw new RuntimeException("Stub!");
280         }
281 
finalize()282         protected void finalize() throws java.lang.Throwable {
283             throw new RuntimeException("Stub!");
284         }
285 
286         private volatile boolean closeRequested = false;
287 
288         private boolean eof = false;
289 
290         private final java.util.zip.ZipFile.ZipFileInputStream zfin;
291 
292         {
293             zfin = null;
294         }
295     }
296 
297     @SuppressWarnings({"unchecked", "deprecation", "all"})
298     private class ZipFileInputStream extends java.io.InputStream {
299 
ZipFileInputStream(long jzentry)300         ZipFileInputStream(long jzentry) {
301             throw new RuntimeException("Stub!");
302         }
303 
read(byte[] b, int off, int len)304         public int read(byte[] b, int off, int len) throws java.io.IOException {
305             throw new RuntimeException("Stub!");
306         }
307 
read()308         public int read() throws java.io.IOException {
309             throw new RuntimeException("Stub!");
310         }
311 
skip(long n)312         public long skip(long n) {
313             throw new RuntimeException("Stub!");
314         }
315 
available()316         public int available() {
317             throw new RuntimeException("Stub!");
318         }
319 
size()320         public long size() {
321             throw new RuntimeException("Stub!");
322         }
323 
close()324         public void close() {
325             throw new RuntimeException("Stub!");
326         }
327 
finalize()328         protected void finalize() {
329             throw new RuntimeException("Stub!");
330         }
331 
332         protected long jzentry;
333 
334         private long pos;
335 
336         protected long rem;
337 
338         protected long size;
339 
340         private volatile boolean zfisCloseRequested = false;
341     }
342 }
343