Skip to content

Commit

Permalink
Allow converting ZLib files to GZip
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Oct 14, 2023
1 parent cf5dd67 commit 76d7cf4
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.zip.Adler32;

import com.github.NeRdTheNed.deft4j.deflate.DeflateStream;
import com.github.NeRdTheNed.deft4j.util.Util;

public class ZLibFile implements DeflateFilesContainer {
public class ZLibFile implements DeflateFilesContainer, ToGZipConvertible {
DeflateStream deflateStream;

private int CMF;
Expand Down Expand Up @@ -98,4 +99,11 @@ public String fileType() {
return "ZLib";
}

@Override
public List<GZFile> asGZipFiles() throws IOException {
final GZFile gz = new GZFile();
gz.setData(deflateStream);
return Collections.singletonList(gz);
}

}

0 comments on commit 76d7cf4

Please sign in to comment.