code: public static void mapZipFile(final byte[] zipFile, final Map<String, byte[]> output, final String keyPrefix,
              final String keyUnPrefix) {
          try {
              final String fixedKeyPrefix = keyPrefix == null ? "" : keyPrefix;
              final String fixedKeyUnPrefix = keyUnPrefix == null ? "" : keyUnPrefix;
              final ZipInputStream zf = new ZipInputStream(new ByteArrayInputStream(zipFile));
  
              ZipEntry ze = null;
              while ((ze = zf.getNextEntry()) != null) {
                  final String name = ze.getName();
                  final long size = ze.getSize();
  
                  // see if we are working with a file or a directory
                  if (size != 0) {
                      byte[] fileContents = new byte[0];
                      final byte[] fileBuffer = new byte[BUFFER_SIZE];
  
                      int bytesRead = 0;
                      while ((bytesRead = zf.read(fileBuffer, 0, BUFFER_SIZE)) != -1) fileContents = ArrayUtils.addAll(fileContents,
                              bytesRead == BUFFER_SIZE ? fileBuffer : ArrayUtils.subarray(fileBuffer, 0, bytesRead));
  
                      output.put(fixedKeyPrefix + name.replace(fixedKeyUnPrefix, ""), fileContents);
                  }
              }
  
          } catch (final IOException ex) {
             LOG.error("Unable to read file contents", ex);
          }
      }
docs: Takes a ZIP file (as a byte array), and extracts its contents into a map of filename to file contents