private void writeDeflated(byte[] b,int offset,int length) throws IOException {
  if (length > 0 && !def.finished()) {
    entry.bytesRead+=length;
    if (length <= DEFLATER_BLOCK_SIZE) {
      def.setInput(b,offset,length);
      deflateUntilInputIsNeeded();
    }
 else {
      final int fullblocks=length / DEFLATER_BLOCK_SIZE;
      for (int i=0; i < fullblocks; i++) {
        def.setInput(b,offset + i * DEFLATER_BLOCK_SIZE,DEFLATER_BLOCK_SIZE);
        deflateUntilInputIsNeeded();
      }
      final int done=fullblocks * DEFLATER_BLOCK_SIZE;
      if (done < length) {
        def.setInput(b,offset + done,length - done);
        deflateUntilInputIsNeeded();
      }
    }
  }
}

private void writeDeflated ( byte [ ] b , int offset , int length ) throws IOException { if ( length > 0 && ! def . finished ( ) ) { entry . bytesRead += length ; if ( length <= DEFLATER_BLOCK_SIZE ) { def . setInput ( b , offset , length ) ; deflateUntilInputIsNeeded ( ) ; } else { final int fullblocks = length / DEFLATER_BLOCK_SIZE ; for ( int i = 0 ; i < fullblocks ; i ++ ) { def . setInput ( b , offset + i * DEFLATER_BLOCK_SIZE , DEFLATER_BLOCK_SIZE ) ; deflateUntilInputIsNeeded ( ) ; } final int done = fullblocks * DEFLATER_BLOCK_SIZE ; if ( done < length ) { def . setInput ( b , offset + done , length - done ) ; deflateUntilInputIsNeeded ( ) ; } } } }
write implementation for deflated entries .
