Giter Club home page Giter Club logo

Comments (6)

cowtowncoder avatar cowtowncoder commented on July 3, 2024

Looking at code, I think the first thing would be to make ChunkDecoder allow uncompressing into ByteBuffer.
Alternative combinations could include input coming from ByteBuffer, or both input and output being ByteBuffer. Amount of code involved is actually not that big, even with 3 new methods (of which 2 are of course optional for now, since request is for uncompressing into buffer).

After this, there would be question of feeding things incrementally -- that is, finding alternatives to InputStream and OutputStream. For this, block-by-block operation might work best. Output side of things (relevant here) should actually be quite simple; using ByteBuffer for input more complex but can be deferred.

from compress.

cowtowncoder avatar cowtowncoder commented on July 3, 2024

Thinking about this bit more, I think both compression and decompression could perhaps be best handled via callback interfaces, similar to Uncompressor.

from compress.

carryxyh avatar carryxyh commented on July 3, 2024

Is there any progress on this issue? We really need this feature. :)

In addition, we also hope to provide the ability to write compressed data directly into ByteBuffer.

from compress.

cowtowncoder avatar cowtowncoder commented on July 3, 2024

I don't think anyone has worked on this. Contributions welcome!

from compress.

carryxyh avatar carryxyh commented on July 3, 2024

Hi, sorry for late..

I submitted a pull request to Netty. I copied part of the code and made some modifications so that netty can write data directly to ByteBuf with lzf:

netty/netty#9876

The problem is that I only modified VanillaChunkEncoder. It seems that UnsafeChunkEncoder is more complicated for this situation.

For the scenario of using ByteBuffer under Unsafe, how can we achieve it? I have no plan yet...

from compress.

carryxyh avatar carryxyh commented on July 3, 2024

Since DirectByteBuffer itself uses unsafe for reading and writing, it seems that we do not need to resort to additional Unsafe... Let me try it...

from compress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.