0

Are there libraries to compress bits into longs? I am trying to compress bits that I send over a network. Would it make more sense to just put the bits in a png file and transfer that?

smuggledPancakes
  • 9,881
  • 20
  • 74
  • 113
  • 1
    What do you mean?png file is already compressed format.By the way,why are you 'compress' bits into longs?Everything is bits when you sending over a network – BlackJoker Mar 19 '13 at 14:41
  • That is a good point that everything is sent as bits. Couldn't you still compress the bits into longs server server, transfer that as bits, and then unpack client side? I am just trying to minimize the data being sent over the network – smuggledPancakes Mar 19 '13 at 14:50
  • check the java.util.zip package,you may got some idea.there are 2 things to be concerned:1,when data is already compressed(like png),compress it again gennerally won't do you much fevor;2,compressing may consume some cpu time – BlackJoker Mar 19 '13 at 15:03

1 Answers1

1

I assume you're just trying to compress data, not that you need "longs". The java.util.zip package contains classes for reading/writing compressed data using zip/gzip compression.

Blake
  • 581
  • 4
  • 14