/** * Returns the total number of bytes read by the {@code Deflater}. This * method is the same as {@link #getTotalIn} except that it returns a * {@code long} value instead of an integer. */ public synchronized long getBytesRead() { checkOpen(); return getTotalInImpl(streamHandle); }
/** * Returns the total number of bytes of input read by this {@code Deflater}. This * method is limited to 32 bits; use {@link #getBytesRead} instead. */ public synchronized int getTotalIn() { checkOpen(); return (int) getTotalInImpl(streamHandle); }
/** * Returns the total number of bytes written to the output buffer by this {@code * Deflater}. The method is limited to 32 bits; use {@link #getBytesWritten} instead. */ public synchronized int getTotalOut() { checkOpen(); return (int) getTotalOutImpl(streamHandle); }
/** * Returns the {@link Adler32} checksum of the uncompressed data read so far. */ public synchronized int getAdler() { checkOpen(); return getAdlerImpl(streamHandle); }
/** * Returns a the total number of bytes written by this {@code Deflater}. This * method is the same as {@code getTotalOut} except it returns a * {@code long} value instead of an integer. */ public synchronized long getBytesWritten() { checkOpen(); return getTotalOutImpl(streamHandle); }
/** * Resets the {@code Deflater} to accept new input without affecting any * previously made settings for the compression strategy or level. This * operation <i>must</i> be called after {@link #finished} returns * true if the {@code Deflater} is to be reused. */ public synchronized void reset() { checkOpen(); flushParm = NO_FLUSH; finished = false; resetImpl(streamHandle); inputBuffer = null; }
/** * Sets the dictionary to be used for compression by this {@code Deflater}. * This method can only be called if this {@code Deflater} supports the writing * of ZLIB headers. This is the default, but can be overridden * using {@link #Deflater(int, boolean)}. */ public synchronized void setDictionary(byte[] buf, int offset, int byteCount) { checkOpen(); Arrays.checkOffsetAndCount(buf.length, offset, byteCount); setDictionaryImpl(buf, offset, byteCount, streamHandle); }
private native int deflateImpl(byte[] buf, int offset, int byteCount, long handle, int flushParm);
/** * Sets the input buffer the {@code Deflater} will use to extract uncompressed bytes * for later compression. */ public synchronized void setInput(byte[] buf, int offset, int byteCount) { checkOpen(); Arrays.checkOffsetAndCount(buf.length, offset, byteCount); inLength = byteCount; inRead = 0; if (inputBuffer == null) { setLevelsImpl(compressLevel, strategy, streamHandle); } inputBuffer = buf; setInputImpl(buf, offset, byteCount, streamHandle); }
/** * Returns the total number of bytes written to the output buffer by this {@code * Deflater}. The method is limited to 32 bits; use {@link #getBytesWritten} instead. */ public synchronized int getTotalOut() { checkOpen(); return (int) getTotalOutImpl(streamHandle); }
/** * Returns the {@link Adler32} checksum of the uncompressed data read so far. */ public synchronized int getAdler() { checkOpen(); return getAdlerImpl(streamHandle); }
/** * Returns the total number of bytes read by the {@code Deflater}. This * method is the same as {@link #getTotalIn} except that it returns a * {@code long} value instead of an integer. */ public synchronized long getBytesRead() { checkOpen(); return getTotalInImpl(streamHandle); }
/** * Returns the {@link Adler32} checksum of the uncompressed data read so far. */ public synchronized int getAdler() { checkOpen(); return getAdlerImpl(streamHandle); }
/** * Returns the total number of bytes written to the output buffer by this {@code * Deflater}. The method is limited to 32 bits; use {@link #getBytesWritten} instead. */ public synchronized int getTotalOut() { checkOpen(); return (int) getTotalOutImpl(streamHandle); }
/** * Returns the total number of bytes of input read by this {@code Deflater}. This * method is limited to 32 bits; use {@link #getBytesRead} instead. */ public synchronized int getTotalIn() { checkOpen(); return (int) getTotalInImpl(streamHandle); }
/** * Returns the total number of bytes of input read by this {@code Deflater}. This * method is limited to 32 bits; use {@link #getBytesRead} instead. */ public synchronized int getTotalIn() { checkOpen(); return (int) getTotalInImpl(streamHandle); }
/** * Returns the total number of bytes written to the output buffer by this {@code * Deflater}. The method is limited to 32 bits; use {@link #getBytesWritten} instead. */ public synchronized int getTotalOut() { checkOpen(); return (int) getTotalOutImpl(streamHandle); }
/** * Returns the total number of bytes read by the {@code Deflater}. This * method is the same as {@link #getTotalIn} except that it returns a * {@code long} value instead of an integer. */ public synchronized long getBytesRead() { checkOpen(); return getTotalInImpl(streamHandle); }
/** * Sets the dictionary to be used for compression by this {@code Deflater}. * This method can only be called if this {@code Deflater} supports the writing * of ZLIB headers. This is the default, but can be overridden * using {@link #Deflater(int, boolean)}. */ public synchronized void setDictionary(byte[] buf, int offset, int byteCount) { checkOpen(); Arrays.checkOffsetAndCount(buf.length, offset, byteCount); setDictionaryImpl(buf, offset, byteCount, streamHandle); }
/** * Sets the dictionary to be used for compression by this {@code Deflater}. * This method can only be called if this {@code Deflater} supports the writing * of ZLIB headers. This is the default, but can be overridden * using {@link #Deflater(int, boolean)}. */ public synchronized void setDictionary(byte[] buf, int offset, int byteCount) { checkOpen(); Arrays.checkOffsetAndCount(buf.length, offset, byteCount); setDictionaryImpl(buf, offset, byteCount, streamHandle); }