-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
haxe.zip.Reader doesn't work for hxnodejs 6.9.0 + Haxe 3.4.7 #118
Comments
I don't think it ever worked actually, it was a run-time error instead. Good news is that I actually have a somewhat working package haxe.zip;
import js.node.Buffer;
import js.node.Zlib;
class Uncompress {
final windowBits:Null<Int>;
public function new( ?windowBits : Int ) {
this.windowBits = windowBits;
}
public function execute( src : haxe.io.Bytes, srcPos : Int, dst : haxe.io.Bytes, dstPos : Int ) : { done : Bool, read : Int, write : Int } {
var src = js.node.Buffer.hxFromBytes(src).slice(srcPos);
var dst = js.node.Buffer.hxFromBytes(dst);
var res = cast Zlib.inflateRawSync(src, cast {info: true, /* windowBits: windowBits */});
var engine = res.engine;
var res:Buffer = res.buffer;
dst.set(res, dstPos);
return {done: true, read: engine.bytesRead, write: res.byteLength};
}
public function setFlushMode( f : FlushMode ) {
}
public function close() {
}
public static function run( src : haxe.io.Bytes, ?bufsize : Int ) : haxe.io.Bytes {
var buffer = js.node.Zlib.inflateSync(js.node.Buffer.hxFromBytes(src),bufsize == null ? {} : {chunkSize : bufsize});
return buffer.hxToBytes();
}
} |
Well, I'm pretty sure it used to work, since we have working code that uses |
Could it be the case that your zips are not really compressed? Because then it bails out without trying to call And the default Haxe's implementation of Anyway I'll try to fix this soon! |
Ahhh, your are spot on, that is actually the case my colleague just told me. Thanks a lot. We will just stay on 4.0.9 for now. |
Hey @nadako Any plans on releasing this change? |
After updating from 4.0.9 to 6.9.0 the following doesn't compile with Haxe 3.4.7:
haxe.zip.Reader.unzip(null);
It gives the following error:
C:\HaxeToolkit\haxe\std/haxe/zip/Reader.hx:198: characters 10-38 : haxe.zip.Uncompress does not have a constructor
The text was updated successfully, but these errors were encountered: