Java encoder #130

Open
opened 2026-01-29 20:37:00 +00:00 by claunia · 21 comments
Owner

Originally created by @RehanSaeed on GitHub (Aug 5, 2016).

I'm investigating Brotli for use in Java Android apps. I'm not aware of any project which provides this capability (if you are, I'd like to know), so I would like to build an interceptor for Android's OkHttp that compresses/decompresses using Brotli. Would someone be kind enough to point me to the correct release of the Brotli native library that would work on Android devices?

Related: https://github.com/square/retrofit/issues/1957

Originally created by @RehanSaeed on GitHub (Aug 5, 2016). I'm investigating Brotli for use in Java Android apps. I'm not aware of any project which provides this capability (if you are, I'd like to know), so I would like to build an interceptor for Android's OkHttp that compresses/decompresses using Brotli. Would someone be kind enough to point me to the correct release of the Brotli native library that would work on Android devices? Related: https://github.com/square/retrofit/issues/1957
Author
Owner

@eustas commented on GitHub (Aug 11, 2016):

Internally we use SWIG and JNI wrappers for brotli library.
We plan publish them closer to Brotli 1.0.0 release.
Also we have pure-java brotli decoder. And, again, it will published a little bit later. Sorry.

@eustas commented on GitHub (Aug 11, 2016): Internally we use SWIG and JNI wrappers for brotli library. We plan publish them closer to Brotli 1.0.0 release. Also we have pure-java brotli decoder. And, again, it will published a little bit later. Sorry.
Author
Owner

@RehanSaeed commented on GitHub (Aug 11, 2016):

I had assumed that as Brotli was now a standard, that the library would be complete. If this is not the case, is there somewhere I can read about what's missing, what's planned and look at a the roadmap?

A pure Java implementation would be great, are there any other languages planned as part of 1.0?

@RehanSaeed commented on GitHub (Aug 11, 2016): I had assumed that as Brotli was now a standard, that the library would be complete. If this is not the case, is there somewhere I can read about what's missing, what's planned and look at a the roadmap? A pure Java implementation would be great, are there any other languages planned as part of 1.0?
Author
Owner

@eustas commented on GitHub (Aug 11, 2016):

There is third-party port to JavaScript and Rust.
Not sure, may be even to Go.
v1.0.0 is not about format, it is about API. We need to make a final clean-ups (remove deprecated API) and make sure that API is portable and easy to use. So, I believe, we are almost here.
So, when v1.0.0 is released, API is considered stable -> it is good time to write wrappers to different languages...

@eustas commented on GitHub (Aug 11, 2016): There is third-party port to JavaScript and Rust. Not sure, may be even to Go. v1.0.0 is not about format, it is about API. We need to make a final clean-ups (remove deprecated API) and make sure that API is portable and easy to use. So, I believe, we are almost here. So, when v1.0.0 is released, API is considered stable -> it is good time to write wrappers to different languages...
Author
Owner

@RehanSaeed commented on GitHub (Aug 12, 2016):

Cool. Do you have any rough (probably very rough) estimates (or guess-timates) of when v1.0.0 may happen? I'm interested in a Java and C# port and would be willing to help with the C# version if required.

@RehanSaeed commented on GitHub (Aug 12, 2016): Cool. Do you have any rough (probably very rough) estimates (or guess-timates) of when v1.0.0 may happen? I'm interested in a Java and C# port and would be willing to help with the C# version if required.
Author
Owner

@charliermarsh commented on GitHub (Nov 3, 2016):

Chiming in to say that I'm also very interested in this and have been tracking this issue for a while. Very excited to see that the Java port is starting to make it into the codebase (e.g., with 5025365d0f). Is the current Java version in the repo 'safe' to start using externally?

@charliermarsh commented on GitHub (Nov 3, 2016): Chiming in to say that I'm also very interested in this and have been tracking this issue for a while. Very excited to see that the Java port is starting to make it into the codebase (e.g., with 5025365d0fe5a5ca874574b952ef53cfa98ca5c1). Is the current Java version in the repo 'safe' to start using externally?
Author
Owner

@eustas commented on GitHub (Nov 9, 2016):

Hi. Java decoder seems to be ready for usage. We've fuzzed it and tested on a large corpora.
Soon maven artifact will be published as well.
Encoder port is not even planned...

@eustas commented on GitHub (Nov 9, 2016): Hi. Java decoder seems to be ready for usage. We've fuzzed it and tested on a large corpora. Soon maven artifact will be published as well. Encoder port is not even planned...
Author
Owner

@paked commented on GitHub (Nov 15, 2016):

@eustas: Any update on the Maven artefact being published?

@paked commented on GitHub (Nov 15, 2016): @eustas: Any update on the Maven artefact being published?
Author
Owner

@thomasjungblut commented on GitHub (Feb 9, 2017):

@eustas I'm also interested in the mvn artifact. Any news?

@thomasjungblut commented on GitHub (Feb 9, 2017): @eustas I'm also interested in the mvn artifact. Any news?
Author
Owner

@eustas commented on GitHub (Mar 3, 2017):

org.brotli.dec:0.1.1 has been recently released

@eustas commented on GitHub (Mar 3, 2017): org.brotli.dec:0.1.1 has been recently released
Author
Owner

@markehammons commented on GitHub (Oct 20, 2017):

I'm also interested in a java port/jni bindings for brotli

@markehammons commented on GitHub (Oct 20, 2017): I'm also interested in a java port/jni bindings for brotli
Author
Owner

@eustas commented on GitHub (Oct 25, 2017):

JNI bindings are already here, see java/org/brotli/wrapper
Unfortunately, JNI is a headache for portable projects. There is no convenient way to use it out of the box. Currently only Bazel builds JNI artifacts...

@eustas commented on GitHub (Oct 25, 2017): JNI bindings are already here, see java/org/brotli/wrapper Unfortunately, JNI is a headache for portable projects. There is no convenient way to use it out of the box. Currently only Bazel builds JNI artifacts...
Author
Owner

@garydgregory commented on GitHub (May 7, 2018):

Wow, almost two years since this issue was created. Are there ANY plans for a Java BrotliOutputStream?

@garydgregory commented on GitHub (May 7, 2018): Wow, almost two years since this issue was created. Are there ANY plans for a Java BrotliOutputStream?
Author
Owner

@eustas commented on GitHub (May 8, 2018):

Yes, two years seems to be a very long period... But still we have no time for that =(

@eustas commented on GitHub (May 8, 2018): Yes, two years seems to be a very long period... But still we have no time for that =(
Author
Owner

@re-thc commented on GitHub (Jul 2, 2018):

If JNI is a headache would moving to JavaCPP or JNA be a better option? Anything that can be done to move this forward?

@re-thc commented on GitHub (Jul 2, 2018): If JNI is a headache would moving to JavaCPP or JNA be a better option? Anything that can be done to move this forward?
Author
Owner

@eustas commented on GitHub (Jul 2, 2018):

There are JNI wrappers for brotli. Just there is no CMake/make/premake build files for them. Bazel compiles and tests JNI library.

I believe JNA does not work well with "in/out" parameters.
Going to look at JavaCPP.

@eustas commented on GitHub (Jul 2, 2018): There are JNI wrappers for brotli. Just there is no CMake/make/premake build files for them. Bazel compiles and tests JNI library. I believe JNA does not work well with "in/out" parameters. Going to look at JavaCPP.
Author
Owner

@eustas commented on GitHub (Jul 2, 2018):

JavaCPP looks like a no-go - it requires both JDK and compiler installed...

@eustas commented on GitHub (Jul 2, 2018): JavaCPP looks like a no-go - it requires both JDK and compiler installed...
Author
Owner

@hmaclean82 commented on GitHub (Nov 15, 2018):

https://mvnrepository.com/artifact/org.apache.commons/commons-compress/1.5

@hmaclean82 commented on GitHub (Nov 15, 2018): https://mvnrepository.com/artifact/org.apache.commons/commons-compress/1.5
Author
Owner

@CAFxX commented on GitHub (Nov 17, 2018):

@hmaclean82 commons-compress only includes a decoder. This issue is for the encoder.

@CAFxX commented on GitHub (Nov 17, 2018): @hmaclean82 commons-compress only includes a decoder. This issue is for the encoder.
Author
Owner

@stokito commented on GitHub (Aug 28, 2019):

IMHO this should be added on JVM level like GZip stream. Brotli can be used even for jar files instead of zip. But here is a good competitor like ZStd which is even added on linux kernel level.

@stokito commented on GitHub (Aug 28, 2019): IMHO this should be added on JVM level like GZip stream. Brotli can be used even for jar files instead of zip. But here is a good competitor like ZStd which is even added on linux kernel level.
Author
Owner

@Jeff11 commented on GitHub (Feb 6, 2020):

https://github.com/square/okhttp/tree/master/okhttp-brotli

@Jeff11 commented on GitHub (Feb 6, 2020): https://github.com/square/okhttp/tree/master/okhttp-brotli
Author
Owner

@stokito commented on GitHub (Feb 6, 2020):

@Jeff11 the interceptor just uses the official brotli encoder https://github.com/google/brotli/tree/master/java

@stokito commented on GitHub (Feb 6, 2020): @Jeff11 the interceptor just uses the official brotli encoder https://github.com/google/brotli/tree/master/java
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#130