View Javadoc
1   /*
2    * Copyright (C) 2005-2015 Schlichtherle IT Services.
3    * All rights reserved. Use is subject to license terms.
4    */
5   package net.java.truevfs.comp.zip;
6   
7   import java.util.zip.Deflater;
8   
9   /**
10   * An interface for {@link ZipOutputStream} parameters.
11   * 
12   * @author Christian Schlichtherle
13   */
14  public interface ZipOutputStreamParameters
15  extends ZipCharsetParameters {
16  
17      /**
18       * Returns the number of entries which can be additionally accomodated by
19       * the internal hash map without resizing it.
20       * When a new ZIP file is created, this constant is used in order to
21       * compute the initial capacity of the internal hash map.
22       * When an existing ZIP file is appended to, this constant is added to the
23       * number of entries in order to compute the initial capacity of the
24       * internal hash map.
25       * 
26       * @return The number of entries which can be additionally accomodated by
27       *         the internal hash map without resizing it.
28       */
29      int getOverheadSize();
30  
31      /**
32       * Returns the default compression method for entries.
33       * This property is only used if a {@link ZipEntry} does not specify a
34       * compression method.
35       * Legal values are {@link ZipEntry#STORED}, {@link ZipEntry#DEFLATED}
36       * and {@link ZipEntry#BZIP2}.
37       *
38       * @return The default compression method for entries.
39       * @see    ZipEntry#getMethod
40       */
41      int getMethod();
42  
43      /**
44       * Returns the compression level for entries.
45       * This property is only used if the effective compression method is
46       * {@link ZipEntry#DEFLATED} or {@link ZipEntry#BZIP2}.
47       * Legal values are {@link Deflater#DEFAULT_COMPRESSION} or range from
48       * {@code Deflater#BEST_SPEED} to {@code Deflater#BEST_COMPRESSION}.
49       * 
50       * @return The compression level for entries.
51       */
52      int getLevel();
53  }