Extend deflate to support custom window size