(ZipEntry ze)
| 236 | } |
| 237 | |
| 238 | public InputStream getInputStream(ZipEntry ze) throws IOException { |
| 239 | long start = ze.getDataOffset(); |
| 240 | int method = ze.getMethod(); |
| 241 | InputStream is = new BridgeInputStream(archive, start, method == METHOD_STORED ? ze.getSize() : ze.getCompressedSize()); |
| 242 | switch (method) { |
| 243 | case METHOD_DEFLATED: |
| 244 | is = new NoWrapInflaterInputStream(ze, is); |
| 245 | break; |
| 246 | case METHOD_STORED: |
| 247 | break; |
| 248 | default: |
| 249 | throw new IOException("Unsupported compression method " + ze.getMethod() + " (" + ze.getName() + ")"); |
| 250 | } |
| 251 | if (method != METHOD_STORED) { |
| 252 | is = new BufferedInputStream(is, 64 * 1024); |
| 253 | } |
| 254 | return is; |
| 255 | } |
| 256 | |
| 257 | public ZipFile openEntryAsZipFile(ZipEntry entry) throws IOException { |
| 258 | if (entry.getMethod() != METHOD_STORED) { |
no test coverage detected