Changeset 7171 for trunk/src/core/org
- Timestamp:
- Jun 9, 2016, 10:48:07 AM (7 years ago)
- Location:
- trunk/src/core/org/anarres/parallelgzip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/org/anarres/parallelgzip/ParallelGZIPEnvironment.java
r7170 r7171 3 3 import java.util.concurrent.ExecutorService; 4 4 import java.util.concurrent.Executors; 5 import javax.annotation.Nonnull;6 5 7 6 /** … … 16 15 } 17 16 18 @Nonnull19 17 public static ExecutorService getSharedThreadPool() { 20 18 return ThreadPoolHolder.EXECUTOR; -
trunk/src/core/org/anarres/parallelgzip/ParallelGZIPOutputStream.java
r7170 r7171 22 22 import java.util.zip.DeflaterOutputStream; 23 23 import java.util.zip.GZIPOutputStream; 24 import javax.annotation.Nonnegative;25 import javax.annotation.Nonnull;26 24 27 25 /** … … 35 33 private final static int GZIP_MAGIC = 0x8b1f; 36 34 37 @Nonnull38 35 private static Deflater newDeflater() { 39 36 return new Deflater(Deflater.DEFAULT_COMPRESSION, true); 40 37 } 41 38 42 @Nonnull 43 private static DeflaterOutputStream newDeflaterOutputStream(@Nonnull OutputStream out, @Nonnull Deflater deflater) { 39 private static DeflaterOutputStream newDeflaterOutputStream(OutputStream out, Deflater deflater) { 44 40 return new DeflaterOutputStream(out, deflater, 512, true); 45 41 } … … 102 98 103 99 // Master thread only 104 public ParallelGZIPOutputStream( @Nonnull OutputStream out, @Nonnull ExecutorService executor, @Nonnegativeint nthreads) throws IOException {100 public ParallelGZIPOutputStream(OutputStream out, ExecutorService executor, int nthreads) throws IOException { 105 101 super(out); 106 102 this.executor = executor; … … 117 113 * @throws IOException if it all goes wrong. 118 114 */ 119 public ParallelGZIPOutputStream( @Nonnull OutputStream out, @Nonnegativeint nthreads) throws IOException {115 public ParallelGZIPOutputStream(OutputStream out, int nthreads) throws IOException { 120 116 this(out, ParallelGZIPEnvironment.getSharedThreadPool(), nthreads); 121 117 } … … 129 125 * @throws IOException if it all goes wrong. 130 126 */ 131 public ParallelGZIPOutputStream( @NonnullOutputStream out) throws IOException {127 public ParallelGZIPOutputStream(OutputStream out) throws IOException { 132 128 this(out, Runtime.getRuntime().availableProcessors()); 133 129 } … … 213 209 // Master thread only 214 210 /** Emits any opportunistically available blocks. Furthermore, emits blocks until the number of executing tasks is less than taskCountAllowed. */ 215 private void emitUntil( @Nonnegativeint taskCountAllowed) throws IOException {211 private void emitUntil(int taskCountAllowed) throws IOException { 216 212 try { 217 213 while (emitQueue.size() > taskCountAllowed) {
Note: See TracChangeset
for help on using the changeset viewer.