/** * Ensures all bytes sent to the deflater are written to the stream. */ private void flushDeflater() throws IOException { if (entry.entry.getMethod() == DEFLATED) { streamCompressor.flushDeflater(); } }
/** * Deflate the given source using the supplied compression method * * @param source The source to compress * @param method The #ZipArchiveEntry compression method * @throws IOException When failures happen */ public void deflate(final InputStream source, final int method) throws IOException { reset(); int length; while ((length = source.read(readerBuf, 0, readerBuf.length)) >= 0) { write(readerBuf, 0, length, method); } if (method == ZipEntry.DEFLATED) { flushDeflater(); } }
/** * Ensures all bytes sent to the deflater are written to the stream. */ private void flushDeflater() throws IOException { if (entry.entry.getMethod() == DEFLATED) { streamCompressor.flushDeflater(); } }
/** * Deflate the given source using the supplied compression method * * @param source The source to compress * @param method The #ZipArchiveEntry compression method * @throws IOException When failures happen */ public void deflate(final InputStream source, final int method) throws IOException { reset(); int length; while ((length = source.read(readerBuf, 0, readerBuf.length)) >= 0) { write(readerBuf, 0, length, method); } if (method == ZipEntry.DEFLATED) { flushDeflater(); } }