Skip to content
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

Deflater.needsInput() Always returns true #191

Open
lechiefe opened this issue Jun 27, 2023 · 4 comments
Open

Deflater.needsInput() Always returns true #191

lechiefe opened this issue Jun 27, 2023 · 4 comments

Comments

@lechiefe
Copy link

lechiefe commented Jun 27, 2023

I am trying to replace the default JVM Deflater class with the IntelDeflater.

The logic is straight-forward and works perfectly on the default Deflater, however simply swapping it for the Intel version results in the needsInput() method always returning true, no matter how many times the set input method has been called.

def.setInput(buffer, off + idx, writeSize);
     while(!def.needsInput()) {
         //Unreachable code
     }

Perhaps there is a difference in the api that I am missing? Any insight is appreciated.

@lechiefe
Copy link
Author

Update: It would appear that this line in the Deflater class is responsible:

 @Override
    public void setInput(byte[] b, int off, int len) {
        if(lz_stream == 0) reset();

In case its helpful, I am using Linux 6.1.31-2-MANJARO

@mateuszsnowak
Copy link
Contributor

Currently GKL does not fully implement Java Deflater and Inflater API. As of current version 0.8.10 and soon to be released version 0.8.11 GKL supports only a subset of methods from those API, for details please look into IntelDeflater and IntelInflater classes.

Full support of Java Deflater and Inflater API is planned at a later date.

@lechiefe
Copy link
Author

I see, thanks for the quick reply, could you keep this issue open? I would like to get a notification when this support is rolled out.

@mateuszsnowak
Copy link
Contributor

I will leave this issue open until implementation is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants