private static int deflateData(byte[] data, byte[] compressedData) {

		Deflater deflate = new Deflater(Deflater.BEST_COMPRESSION, true);
		deflate.setStrategy(Deflater.HUFFMAN_ONLY);
		deflate.setInput(data, 0, data.length);
		deflate.finish();

		int compressedDataOffset = 0;

		while (!deflate.finished() && compressedDataOffset < compressedData.length) {
			compressedDataOffset += deflate.deflate(compressedData, compressedDataOffset,
				compressedData.length - compressedDataOffset, Deflater.SYNC_FLUSH);
		}

		if (!deflate.finished()) {
			return -1;
		}

		return compressedDataOffset;
	}
Deflate data into compressedData array.  Both arrays must have equal lengths.
@param data
@param compressedData
@return length of compressed data within the compressedData array, or -1 if 
unable to compress.
Ghidra/Framework/DB/src/main/java/db/buffers/DataBuffer.java