Skip to content

Commit

Permalink
fix inflater/deflator
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Nov 1, 2024
1 parent a22e388 commit 2c7c5a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true

version=1.2.1
version=1.2.2

asm_version=9.7.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public static int deflate(Deflater def, ByteBuffer buf, int flush) {

@Stub
public static void setInput(Deflater def, ByteBuffer buf) {
throw new UnsupportedOperationException(
"JVMDowngrader, setInput(ByteBuffer) is not supported because it's impure.");
byte[] remain = new byte[buf.remaining()];
buf.get(remain);
def.setInput(remain);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public static void setDictionary(Inflater inf, ByteBuffer buf) {
}

@Stub
public static void setInput(Deflater def, ByteBuffer buf) {
throw new UnsupportedOperationException(
"JVMDowngrader, setInput(ByteBuffer) is not supported because it's impure.");
public static void setInput(Inflater inf, ByteBuffer buf) {
byte[] remain = new byte[buf.remaining()];
buf.get(remain);
inf.setInput(remain);
}

}

0 comments on commit 2c7c5a9

Please sign in to comment.