How do I make a compression algorithm in Netty?

29 views
Skip to first unread message

goodnews...@gmail.com

unread,
Dec 5, 2019, 1:18:44 AM12/5/19
to Netty discussions
Hello,

I am writing a packet compression algorithm.   I want to make a fast server for many players and to minimize bandwith, I need to maximally compress my packets.

I am using UTF-8, but I can pass characters with value 1024 or 2048 in them.

I thought that I would find maximum character size, then store information inside.

For instance if it was eight bit, I could send 8 binaries in just one character.

If I send a number, I don't want it just to be the characters'0-10' because that is inefficient.

0 is ascii code 48, and knowing I only wanted a range between 1-10, I could make use of the other four bits.

This should be simple, but I don't know the limits. Utf-8 shouldn't send anything higher than 255, but I am getting 2000+ codes if I send em

My string is s

ByteBuff bb;
bb=(Unpooled.copiedBuffer(s,CharsetUtil.UTF_8));
storectx.write(bb):
storectx.flush();


How do I know my limits of bytes in a character sent, or any clues?

,Jim
Reply all
Reply to author
Forward
0 new messages