[Netty 5] Proposal: Use Deflater::deflate(ByteBuffer) in a ZlibEndcoder implementation
See original GitHub issueNetty version
netty-all-4.1.29.Final
Expected behavior
Being able to compress ByteBuf
s without transferring them into a byte array.
Actual behavior
Currently ZlibEncode
r encode copies ByteBuf
’s content into a newly created array if the ByteBuf
is not backed by a byte array. Since JDK 11 we have java.util.zip.Defalter::deflate(ByteBuffer)
which judging by the implementation does the job.
I would propose to provide an additional implementation of ZlibEncoder
and ZlibDecoder
(e.g. NioZlibDecoder
/NioZlibEncoder
) with the requirements JDK 11
or later.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Chapter 5. ByteBuf - Netty in Action - liveBook · Manning
Netty's alternative to ByteBuffer is ByteBuf , a powerful implementation that addresses the limitations of the JDK API and provides a better API...
Read more >Using as a generic library - Netty.docs
nio. ByteBuffer relies on the JVM garbage collector. It works OK for heap buffers, but not direct buffers. By design, direct buffers are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems this could be done within the current implementation transparently.
It looks like #11057 covered this?