public int deflate ( byte [ ] b , int off , int len , int flush ) { if ( b == null ) { throw new NullPointerException ( ) ; } if ( off < 0 || len < 0 || off > b . length - len ) { throw new ArrayIndexOutOfBoundsException ( ) ; } synchronized ( zsRef ) { ensureOpen ( ) ; if ( flush == NO_FLUSH || flush == SYNC_FLUSH || flush == FULL_FLUSH ) { int thisLen = this . len ; int n = deflateBytes ( zsRef . address ( ) , b , off , len , flush ) ; bytesWritten += n ; bytesRead += ( thisLen - this . len ) ; return n ; } throw new IllegalArgumentException ( ) ; } }
Compresses the input data and fills the specified buffer with compressed data . Returns actual number of bytes of data compressed .