Here is the corrected version with improved spelling and grammar: I’m not sure what you’re trying to do. Do you have an HTTP server and want to add compression to it? Mummy (<https://github.com/guzba/mummy>) already does this and is super performant in other ways. Do you have some sort of TCP protocol that needs ZIP compression? Just create a sendZipped/recvZipped and use Zippy (<https://github.com/guzba/zippy>) — it’s really fast, even faster than zlib in most cases. You probably don’t need streams; their overhead is significant. Are you worried about a single if? It likely won’t show up in your profiles, while streaming and compression will.
If you want ultimate speed, I recommend Supersnappy (<https://github.com/guzba/supersnappy>) instead; it’s a really fast compression for the amount of bytes you save. If you’re making a new protocol, I suggest going with UDP instead of TCP. Check out <https://github.com/treeform/netty>.