How to implement deflate (best compression)?

Can you also guide me how can i solve this issue?