public void testCreateArchiveWithStreamTransformer() throws IOException {
    InputStreamTransformer is =
        new InputStreamTransformer() {
          @Nonnull
          public InputStream transform(
              @Nonnull PlexusIoResource resource, @Nonnull InputStream inputStream)
              throws IOException {
            return new BoundedInputStream(inputStream, 3);
          }
        };

    final ZipArchiver zipArchiver = getZipArchiver(getTestFile("target/output/all3bytes.zip"));
    File zipFIle = new File("src/test/resources/test.zip");
    DefaultArchivedFileSet afs = new DefaultArchivedFileSet(zipFIle);
    afs.setStreamTransformer(is);
    afs.setPrefix("azip/");
    zipArchiver.addArchivedFileSet(afs);

    DefaultFileSet dfs = new DefaultFileSet(new File("src/test/resources/mjar179"));
    dfs.setStreamTransformer(is);
    dfs.setPrefix("mj179/");
    zipArchiver.addFileSet(dfs);

    PlexusIoFileResourceCollection files = new PlexusIoFileResourceCollection();
    files.setBaseDir(new File("src/test/resources"));
    files.setStreamTransformer(is);
    files.setPrefix("plexus/");
    zipArchiver.addResources(files);

    zipArchiver.createArchive();
  }
  public void testAddArchivedFileSet() throws Exception {
    File toBeAdded = new File("src/test/resources/test.zip");
    DefaultArchivedFileSet sfd = DefaultArchivedFileSet.archivedFileSet(toBeAdded);
    File zipFIle = getTestFile("target/output/withZip.zip");
    final ZipArchiver zipArchiver = getZipArchiver(zipFIle);
    InputStreamTransformer is =
        new InputStreamTransformer() {
          @Nonnull
          public InputStream transform(
              @Nonnull PlexusIoResource resource, @Nonnull InputStream inputStream)
              throws IOException {
            return new BoundedInputStream(inputStream, 3);
          }
        };
    sfd.setStreamTransformer(is);
    zipArchiver.addArchivedFileSet(sfd);
    zipArchiver.createArchive();

    final ZipUnArchiver zipUnArchiver = getZipUnArchiver(zipFIle);
    File destFile = new File("target/output/withZip");
    destFile.mkdirs();
    zipUnArchiver.setDestFile(destFile);
    zipUnArchiver.extract();
    File a3byteFile =
        new File(
            destFile,
            "Users/kristian/lsrc/plexus/plexus-archiver/src/main/java/org/codehaus/plexus/archiver/zip/ZipArchiver.java");
    assertTrue(a3byteFile.exists());
    assertTrue(a3byteFile.length() == 3);
  }