Getting  "IOException Not in Gzip format "

Hi,
I am getting this *"IOException Not in GZip format "* while Uncompresing.
I have checked the data. It's already in gzip format (compressed).
My Code looks like:-
byte[] HTMLCompress = new byte[contentlength];
            byte[] HTMLUnCompress = new byte[10000];
            if(b != null) {
                for( int total = b.length-1 , i = contentlength-1 ; i >= 0 ; i-- ){
                    HTMLCompress[i] = b[total--];
            String htmlstr = new String();
            if(HTMLCompress.length > 0) {
                ByteArrayInputStream bs = new ByteArrayInputStream(HTMLCompress);                
                System.out.println("Inside >> " + bs);
                GZIPInputStream gzp = new GZIPInputStream(bs,contentlength);                
                int noread = gzp.read(HTMLUnCompress);
                for( int i = 0 ; i < noread ; i++ ){
                    htmlstr += (char)HTMLUnCompress;
*Can anyone please suggest me what's the issue with this...*.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

The exception is clear : IOException Not in GZip format
So check what contains really the variable 'b'.
Then what does the first loop ???
instead of
        for( int total = b.length-1 , i = contentlength-1 ; i >= 0 ; i-- ){
            HTMLCompress[i] = b[total--];
        }Try this :
        for (int i=0; i<b.length; i++) {
            HTMLCompress[i] = b;
or System.arraycopy(b, 0, HTMLCompress, 0, contentlength);
I repeat, probably b buffer doesn't containt gzip format. Check you stuff before sample code you posted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Not in GZIP format error while trying to unzip the file

    I'm using GZIPInputStream in order to read data from zipped file.
    It worked perfectly from command line. I have to execute the same code from crontab and it gave me the exception:
    java.io.IOException: Not in GZIP format
    It tries to check the GZIP_MAGIC number and for some reason failed.
    The stack trace I'm getting points to GZIPInputStream constructor.
    GZIPInputStream input = new GZIPInputStream( new FileInputStream( fileName));
    Any help will be highly appreciated.
    Thanks,
    Arnold

    This may be a little late for you, but I am having the same problem. I am using an encryption package as well. I created input and output streams to wrap my encryption package. (javax.?? has something similar)
    Anyway, my algorithm goes: data -> gzip -> encrypt --------- ->decrypt -> gzip ->data
    If I used encryption without the gzip everything works fine, and if I use gzip without the encryption it works fine as well. But if I use them in conjuction, bad thing happen.
    I copied versions of the GZIPInput and output stream classes from java.util.zip and made my own so I could put in debug code. Then I saw what was happening. GZIP writes a header of 8b1f. It does this by writing a first to 1f as a byte (this is 31 in decimal) and then the 8b (this is 139 unsigned byte or -117 signed byte).
    My debug code shows that it writes 31,-117 to the stream, but reads 31,139 when I don't use encryption and 31,-117 when I do. Another strange thing about this, though, is that everywhere I have debug code, this is the only byte that prints out unsigned in my debug messages... When encryption is turned on this same debug message prints -117.
    I have no idea why this is happening. To test things some more, I changed my copy of the gzipinputstream to compare this header value with the GZIP_MAGIC number (35615) and with -29921. Now everything works perfectly. There has to be a better solution for this, but I don't know what it is yet.
    GZIP_MAGIC is 8b1f sent as two bytes 1f and then 8b, and then shifting the 8b.
    -117, using the Integer.toString(-117,16), gives a hex of -75. Using the same methodology as above, we can get -751f which is -29921.
    The header check is essentially:
    if ((int)readUByte(in) << 8) | (int)readUByte(in) != GZIP_MAGIC)
    your screwed
    So change this store the value in a variable and compare it to GZIP_MAGIC and -29921 and your problem will disappear.
    I am not sure what they were thinking. readUByte is a simple read. There is nothing unsigned about it. There is probably some casting somewhere along here that is causing the error, but nothing I am doing seem incorrect.
    Hope this helps. Actually, I hope you have solved your problem by now, but if not,... If you have any insights, I would appreciate hearing them.

  • Not in GZIP format problem

    I am experiencing the following IOException when using the GZIPInputStream:
        java.io.IOException: Not in GZIP format
            at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:131)
            at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58)
            at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:68)
            ...I am trying to read an Entity Body from an HTTP response that has been compressed using GZIP compression. I read in chunks of 4K bytes, but my first read always ends at the Entity Body (this is not a problem of course, but I thought it was a bit odd). However, this my first read of an InputStream always gives me the following:
    Status-Line
    Headers
    CRLF
    So, the next read would return me the first byte of the Entity Body. By investigating the supplied Headers I discovered that GZIP compression is used. Therefore, I create a GZIPInputStream with the original InputStream as parameter. But when I start reading from the GZIPInputStream I get the mentioned exception.
    Looking into the GZIPInputStream it seems to have a problem with the GZIP header magic number (0x8b1f). This magic number consists of two bytes. I thought it would be nice to try the following, just to see what happend:
        byte[] gzipHeader = new byte[2];
        inputStream.read(gzipHeader, 0, gzipHeader.length);
        GZIPInputStream gzipInputStream =
            new GZIPInputStream(
                new SequenceInputStream(
                    new ByteArrayInputStream(gzipHeader), inputStream));
        ...And guess what? This seems to solve my problem, however I would not consider this to be a nice fix. Looking to see what is in the byte array, I discovered the following: 0x1f8b. I found the following snippet of code in GZIPInputStream:
        private int readUShort(InputStream in) throws IOException {
            int b = readUByte(in);
            return ((int)readUByte(in) << 8) | b;
        }This method is used to read in the GZIP header magic number. Now correct me if I'm wrong, but reading the bytes 0x1f8b results in the desired 0x8b1f. Therefore my little test mentioned earlier works, but why doesn't the following work:
        GZipInputStream gzipInputStream = new GZIPInputStream(inputStream);
        ....Can anybody help me with this?
    Jack...

    http://en.wikipedia.org/wiki/Gzip
    Other uses
    The �Content-Encoding� header in HTTP/1.1 allows clients to optionally receive compressed HTTP responses and (less commonly) to send compressed requests. The standard itself specifies two compression methods: �gzip� (RFC 1952; the content wrapped in a gzip stream) and �deflate� (RFC 1950; the content wrapped in a zlib-formatted stream). Compressed responses are supported by many HTTP client libraries, almost all modern browsers and both of the major HTTP server platforms, Apache and Microsoft IIS. Many server implementations, however, incorrectly implement the protocol by using the raw DEFLATE stream format (RFC 1951) instead. The bug is sufficiently pervasive that most modern browsers will accept both RFC 1951 and RFC 1950-formatted data for the �deflate� compressed method.

  • Exception invoking JSF : Not in GZIP format

    Hi,
    I am trying integrating jsf and spring.
    I am using JBoss server, JSF1.2 and Spring Framework 2.5.
    When I submit my jsf page, I am getting this exception:
    06:57:34,839 FATAL [renderkit] Not in GZIP format
    java.io.IOException: Not in GZIP format
         at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
         at java.util.zip.GZIPInputStream.<init>(Unknown Source)
         at java.util.zip.GZIPInputStream.<init>(Unknown Source)
         at com.sun.faces.renderkit.ResponseStateManag
    Have you experienced this problem earlier? Let me know?
    Edited by: Laddha on Nov 21, 2007 12:14 PM
    Edited by: Laddha on Nov 21, 2007 2:01 PM
    Edited by: Laddha on Nov 21, 2007 2:07 PM

    It is working now, I just hand coded the jsf page now. Probably content copied earlier was problem.

  • Not in GZip Format Exception

    Hi All,
    When decompressing zipped data using GZIPInput stream, i get this exception "Not in GZip Format Exception". I am not quite sure what to do on this. I have been through forums and all but din get any answer for this. So any help on this is highly appreciated.
    Thanks
    Jeevan

    >
    I dint get u, what is this zip != gzip?
    zip.format()) != gzip.format()

  • File not in GZIP format

    Hello, i have already searched the forum but no one seems to give clear answers on why GZIPInputStream gzip = new GZIPInputStream(new (*any input stream)); throws an IOException: File not in GZIP format...
    can somebody please help me with a code sample. My program sends compressed files on the network and the receiving end decompresses it. But it doesnot work because of the said exception...

    i badly need your help *: (*

  • Oracle 9.0.1 Linux Download Disk 1 Is NOT in gzip Format

    Hi,
    I tried to download twice Oracle 9.0.1 Linux on my Windows first, then tranfer to my Linux machine. All the other disks (gz files) are transfered and uncompressed into cpio files, expect Disk 1, Linux9i_Disk1.cpio.gz.
    I checked Linux9i_Disk1.cpio.gz first using WinZip on Windows, then gunzip on Linux. The problem is the same: Linux9i_Disk1.cpio.gz is not in gzip format.
    Since all the other Disks (.cpio.gz files) works fine, my suspicion is that Linux9i_Disk1.cpio.gz is corrupted on the server. Has anyone in Oracle really tested the download recently?
    Of cause next monday I will check direct download to my Linux machine at work.
    Thanks in advance!
    Dong Liu
    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    - Server name
    - Filename
    - Date/Time
    - Browser + Version
    - O/S + Version
    - Error Msg

    Hi,
    I reported that Oracle 9.0.1 Linux Download Disk 1 does not work if I first download it to Windows. My colleague downloaded it to a Linux machine, and it can be unzipped.
    So only one disk file can only be directly downloaded to Linux.

  • Applet error, "not in gzip format"

    When trying to open an applet Java console shows:
    Error in server data transaction: Not in GZIP format
    Error while downloading productGroups. Mess=Not in GZIP format
    basic: Applet initialized
    basic: Starting applet
    basic: Applet started
    basic: Told clients applet is started
    But no applet appears :-(
    Using kubuntu, firefox 3.08, java version "1.6.0_13"
    Using it in windows xp and firefox works fine.
    Any suggestions?

    When trying to open an applet Java console shows:
    Error in server data transaction: Not in GZIP format
    Error while downloading productGroups. Mess=Not in GZIP format
    basic: Applet initialized
    basic: Starting applet
    basic: Applet started
    basic: Told clients applet is started
    But no applet appears :-(
    Using kubuntu, firefox 3.08, java version "1.6.0_13"
    Using it in windows xp and firefox works fine.
    Any suggestions?

  • Not in GZip format...

    On the download page for the linux version of 9i Lite, it says to gunzip, when in fact, the file I recieved via the download was NOT gzipped at all. It was simply a renamed cpio.
    Just thought I should bring that to your attention before you get a flood of emails asking "How do I get this thing to work?" :)
    me

    hello,
    scroll down the site from where you have downloaded the file and you will know how to extract it..it is all there on the site
    Directions
                  1. Unzip the file: gunzip <filename>
                  2. Extract the file: cpio -idmv < <filename>
                  3. Installation guides and general Oracle Database 10g documentation can be found here.
                  4. Review the certification matrix for this product here.thanks and regards
    VD

  • Download 9204 DB for Linux: "not in gzip format

    as anybody else noticed problems after downloading the new 9204 drop of the Linux DB files?
    The checksums are different from what is reported on the download page, and from the content it seems there is some "garbage" at the top of the gz files?

    Ok, i found the problem.
    Although the files have the .gz extension, they are actually not gzipped. They are regular cpio archived (not compressed).

  • 9ias linux download not in gzip format

    I am unable to unzip the download files ie Linux_ias1022_Disk1.cpio.gz (461,608 kb) and I have also tried to unzip them on my solaris systems with the same result. FTP binary, everything is accurate except the unzip. PLEASE ANSWER MY QUERY, SECOND POSTING.

    Now I know why you guys aren't answering my post. I downloaded another gz file from the site glibc-2.1.3-stubs.tar.gz (92 kb) and I decompressed it fine. The problem is that nothing on the ias1022 Linux download works because you don't want it to be downloaded, right? Do you really have to waste my time with this grade F technet support game? I mean I've been wasting my time with this distribution for two days, and it really is crap, right? Since the company I work for is a customer and I'm supposed to be evaluating this software, don't you think someone there should give a damn?

  • About gzip format

    I download 817solaris.cpio.gz file into my win98 pc then ftp to
    Unix box. When I try to gunzip this file. It shows it's not in
    gzip format. I even tried type bin first before ftp the whole
    file then use put command. Any suggestion?

    Hi, welcome to Apple Discussions.
    Before you start you need a complete backup of your entire iTunes Library & media plus of course any other data you'll want on your rebuilt machine.
    *Fast backup for iTunes library (Windows Only)*
    Grab SyncToy 2.1, a free tool from MS. This can be used to copy your entire iTunes library (& other important data folders) onto another hard drive or network share. You can then use SyncToy periodically to synchronise or echo your library to the backup. A preview will show which files need to be updated giving you a chance to spot unexpected changes and during the run only the new or updated files will be copied saving lots of time. And if your media is all organised below the main iTunes folder then you should also be able to open the backup library on any system running the same version of iTunes.
    When the time comes to reformat your PC, do a final sync, then open iTunes & deauthorize the PC, reformat & rebuild Windows, copy the backup folders back to the same location as they were previously, install iTunes and it should all work perfectly.
    tt2

  • I'm running snow leopard. The try to open any .mov file in Quicktime, and I get an error message that says, "The document xyz.mov could not be opened. The movie is not in a format that Quicktime player understands. I'm a recent upgrade to Snow Leopard.

    I'm running snow leopard. The try to open any .mov file in Quicktime, and I get an error message that says, "The document xyz.mov could not be opened. The movie is not in a format that Quicktime player understands. I'm a recent upgrade to Snow Leopard.
    Help!
    Thanks, Mark

    Unfortunately, the error message gives no details about what codec might be missing or what it needs.
    If the file can't be opened in QT, it only means you cannot use the QT "Inspector" window to check what compression formats were used to create the file. It does not mean you can't use the Finder "Information" window to check on the compression formats or use a third party media information window (e.g., like VLC which will open many compression formats not supported natively by QT) to determine what kind of data is included in the MOV wrapper. If the file cannot be opened in any app, it is usually a good sign that the file itself is corrupted.
    It's a stupid error message. Apple should do better than that.
    Error trapping is quite extensive but there are still many areas which require human oversight. The message is telling you that either the container has a problem (e.g., not properly terminated, non-standard, or corrupted) or that one or more of the compression formats used is not supported by your current codec component configuration or that the data was encoded using non-standard settings or preferences not supported by QT or that the fourCC code does not match the data contained in the file or that there are timecode inconsistencies, etc., etc., etc. In short there are a near infinite number of possible problems for which it would be very difficult/nearly impossible to program error trapping depending on your sourcing of content and how you process it before it reaches the player app. Think of it like trying to play a BD disc in an DVD player.
    I'll call Apple support when I get a chance.
    Chances are good that they will end up sending you back here. In any case, it is often a good idea to post a sample file for examination by other QT users. At the very least, they should be able to tell you if the sample file will play on other systems which would indicate whether or not the file itself is bad and under the best of circumstances whould allow them to examing the file in detail for various common problems.

  • I have Photoshop CS5.1 (bought in 2011). The photoshop Camera Raw plug-in is not recognizing the format of my new Nikon D610. I updated the version of my Camera Raw plug in and am still getting this message when trying to open images in photoshop. Please

    I have Photoshop CS5.1 (bought in 2011). The photoshop Camera Raw plug-in is not recognizing the format of my new Nikon D610. I updated the version of my Camera Raw plug in and am still getting this message when trying to open images in photoshop. Please help.

    This link shows that ACR 8.3 supports the Nikon D610 and 6.7.1 was the final version for CS5.
    Camera Raw plug-in | Supported cameras
    So you can upgrade to CS6 and ACR 8.7.1
    or using the DNG converter, convert your Nikon raw files to dng format to open in CS5.
    Here is the download link: Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.7.1
    or Windows: Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.7.1
    And here is a great video tutorial on how to use the converter.
    https://www.youtube.com/watch?v=0bqGovpuihw
    Gene

  • I have bought un-useful app which is an image converter app. It did not mention unsupported formats can I get my money back?

    Dear Apple support team
    I have just bought an application, it is an image converter, but it did not mention that it doesn't support a specified image formats. When I bought it I could not get any use of it because it does not dupport NTF format.
    Can I get my money back?!
    Thank you,
    Regards.

    Refunds -
    All sales are final. the App Store is not a try it and return it situation.
    Apple sometimes gives a one-time per account refund. If this is the app which you wish to use your possible one refund with use the Report a Problem link in the emailed receipt that you receive on the purchase in 24 to 48 hours to ask for the refund.
    If your purchase was in the last few weeks you may also use this link to report a problem;
    https://reportaproblem.apple.com

Maybe you are looking for

  • Issue Root Cause Question - WebIntelligenceProcessingServer

    Hi, Yesterday our SAP BI based portal server suffered a dramatic decrease of perfomance that prevented reports to be viewed (users were able to login into portal, but when clicked on a given report it showed the clock progress bar with no results..)

  • Problem with RFC and empty table

    Hi, I have a problem using and RFC function module. The problem is that the RFC returns a table type, but even though the table is emtpy the tag is returned. I have this target structure who has a required subsstructure: Input: <RFC_function_module>

  • Url from OA page - urgent plz

    Hi , I have a URL in a seeded page which should open the file repository through the URL. my URL value is: \\ottfs1 which should open the file repository.But i am facing the problem in opening this URL. http:// is being appending to the url value.I a

  • Help needed in creating easy flash photo menu

    First hello to all of you And greetings from Poland Could somebody help me or give me a guide, maybe a tutorial how to create an easy flash photo menu in AS3 or 2. Let me explain what I want to do this is my image menu done i PSD is my image menu don

  • WRT54G V.5 & PDA setup problem

    Everything else in the network is up and running fine but I am trying to connect my HP IPAQ hx2755 with out success due to the fact I can not find my passcode for the WPA.. What would be the easiest way to resolve this dilema??? Should I just reset t