• Post Reply Bookmark Topic Watch Topic
  • New Topic

Auto-compression of sent data?  RSS feed

 
Gerry Giese
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all - is there a way to send data across a socket connection that is compressed automatically instead of pre-compressing the data and then sending it? Thanks!
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, wrap the OutputStream created on the socket with a GzipOutputStream. Any byte array you write to it will be compressed and sent in one call.
------------------
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!