Perhaps you could've compressed it had you kept running for just a second longer?
Obviously, the code will not halt until it compresses the stream successfully.