CFZip Doesn’t support gz!?

While working on a personal project dealing with ipblock lists, it came time to cfhttp download a compressed (gz) file, figured I could just decrompress it with cfzip, but lo and behold, ACF doesn’t support it.  (Though, I heard ralio might, not sure)

First I came across this:
Which was good (aside from auto-appending .tar), but I really didn’t want to work from files, since cfhttp.fileContent already constains a byteOutputArray, then I came across this stackoverflow post:

component {
	public any function uncompress(required array byteArray, string charset='utf8') {
		var r = '';
		var buffer = createObject('java','').init();
		var input = createObject('java','').init(arguments.byteArray);

		var inflater = createObject('java','').init(input);
		var bbuf = repeatString(" ",256).getBytes();

		while(true) {
			r =;
			if(r < 0) {
			buffer.write(bbuf, 0, r);
		return buffer;

	public array function compress(required string input, string charset='utf8') {
		var buffer = createObject('java','').init();
		var deflater = createObject('java','').init(buffer);
		return buffer.toByteArray();

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

WordPress Appliance - Powered by TurnKey Linux