private static InputStream createUncompressedStream(InputStream possiblyCompressed) {
        if(!possiblyCompressed.markSupported()) {
            possiblyCompressed = new BufferedInputStream(possiblyCompressed, 512 * 1000);
        }

        try {
            return new CompressorStreamFactory().createCompressorInputStream(possiblyCompressed);
        } catch(CompressorException e) {
            return possiblyCompressed;
        }
    }
Helper functions for working with Docker image archives, as produced by
the docker:save mojo.
src/main/java/io/fabric8/maven/docker/util/ImageArchiveUtil.java