Skip to content

[BUG] EncoderJNI.Operation is not public, preventing the use of EncoderJNI.push(Operation op, int length) #144

@joakime

Description

@joakime

Describe the bug
When attempting to integrate Brotli4J into Eclipse Jetty we found the following ...

  • The com.aayushatharva.brotli4j.encoder.Encoder class does not have the features we need (process many ByteBuffers, but not via the Channel APIs)
  • We cannot even instantiate com.aayushatharva.brotli4j.encoder.Encoder, as the only constructor is package private.
  • The BrotliEncoderChannel seems to be the recommended approach, but the Channel abstraction is too harsh for our needs, we need to be able to handle the ByteBuffers for input, and the ByteBuffers for output, and handle needs for input/output, to provide sane backpressure for HTTP/1, HTTP/2, and HTTP/3 use cases. (nio Channels are not appropriate for all use cases)
  • That leaves us the com.aayushatharva.brotli4j.encoder.EncoderJNI.Wrapper as the level of interaction we are looking for, but we cannot use it due to class permissions issues.

To Reproduce
Steps to reproduce the behavior:

  1. Write a testcase that uses EncoderJNI.Wrapper from a package that is not com.aayushatharva.brotli4j.encoder. (use com.aayushatharva.brotli4j.tests yourself)
  2. Attempt to use EncoderJNI.push(Operation op, int length)

Expected behavior
The ability to use the public features of EncoderJNI.

Logs
If applicable, add logs to help explain your problem.

Platform (please complete the following information):

  • Device: Linux
  • OS: Ubuntu 22.04.04 LTS
  • Java Version 11, 17, 21, and 22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions