• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GZIP Compression without headers

 
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone tried GZIP compression ?

Can we have the compressed data without any headers ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using GZIP compression is extremely common, although in many cases it's applied automatically.

What do you mean by:

the compressed data without any headers

 
Santosh Kumar Nayak
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When the data is compressed then in that scenario we get the compressed data.

Now Compressed data= Header+ actual data

Can we have only "actual data" in the compressed form ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GZIP or for that matter any protocol have specific protocol headers to understand the real data. If you remove those protocol parts then it's no longer GZIP. What exactly are you trying to do?
 
Santosh Kumar Nayak
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We were trying to compress some data via Java and C language.

Now there was a mismatch in the header part of the compressed data hence I had the query if we can remove the header information.
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure they are both using the GZIP compression algorithm.
 
Santosh Kumar Nayak
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, they both are using the same zipping algorithm still the in-consistency is present.

Hence we are planning to use Zlib and perform compression from both the platforms.
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you did not ovelook something?
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's extremely unlikely the the Java GZIP classes are platform dependent. It goes against everything Java stands for.
Compressing on one platform and de-compressing on another using the standard library must be possible or the classes would be next to useless.

Unless you show us the code you are using (ideally an SSCCE) it's not possible to advise on how to resolve the issue.
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Based on the OP's other thread dealing with GZIP I would say that there is a good chance that he is converting the bytes of the GZIP output to a String ignoring the fact that they are binary. The transformation 'binary bytes' ( using new String(bytes) )-> String -> "binary bytes' (using String.getBytes()) is not guaranteed to get back the original bytes; it depends on the character encoding used and this simplistic approach cannot be recommended.
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Richard, I hadn't read the OP's other thread.

The thread Richard is referring to is https://coderanch.com/t/616879//java/Stream-Bytes
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic