which one is the best compression algorihm in java for compressing data

Compression is an algorithm, independent of it's implementation language.

You could implement ZIP in assembler, C or Java (or pretty much anything else) and the end result would be the same.

Or do you have some other metric for "best"?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.