public InputStream getInputStream(final ZipEntry ze) throws IOException, ZipException {
   if (!(ze instanceof Entry)) {
     return null;
   }
   final OffsetEntry offsetEntry = ((Entry) ze).getOffsetEntry();
   ZipUtil.checkRequestedFeatures(ze);
   final long start = offsetEntry.dataOffset;
   final BoundedInputStream bis = new BoundedInputStream(start, ze.getCompressedSize());
   switch (ze.getMethod()) {
     case 0:
       {
         return bis;
       }
     case 8:
       {
         bis.addDummy();
         final Inflater inflater = new Inflater(true);
         return new InflaterInputStream(bis, inflater) {
           public void close() throws IOException {
             super.close();
             inflater.end();
           }
         };
       }
     default:
       {
         throw new ZipException("Found unsupported compression method " + ze.getMethod());
       }
   }
 }