Skip to content

Instantly share code, notes, and snippets.

View lenborje's full-sized avatar

Lennart Börjeson lenborje

  • Stockholm, Sweden, Europe
View GitHub Profile
@lenborje
lenborje / Zip.java
Created June 2, 2016 12:19
Minimal zip utility in java. It can process entries in parallel. Utilizes Java 8 parallel Streams combined with the ZIP FileSystem introduced in Java 7.
import java.io.*;
import java.net.*;
import java.nio.file.*;
import java.util.*;
import java.util.stream.*;
import static java.util.stream.Collectors.*;
/**
* This class creates zip archives. Instead of directly using {@link java.util.zip.ZipOutputStream},
* this implementation uses the jar {@link FileSystem} available since Java 1.7.<p>