Problem when uncompressing using GZIPInputStream

i uploaded a 2.7MB gzipped byte array into MySQL database. The original file size before compressing was 9.3MB. When I retrieve the file from the database, everything works fine, but after uncompressing it using GZIP, it's only 9.2MB. I compared both the files, both look same in the beginning, but the last bytes are missing in the retrieved file. Here is my code.Can somebody give me some insight?
byte[] bytes=getFile();
ByteArrayInputStream bStream=new ByteArrayInputStream(bytes);
GZIPInputStream iStream=new GZIPInputStream(bStream);
File file = new File("/home/antn/file/testfile.cel");
OutputStream oStream=new FileOutputStream(file);
byte [] buf = new byte[512];
int len = 0;
while ( (len=iStream.read(buf))!= -1 )
oStream.write(buf,0,len);
iStream.close();
oStream.close();
bStream.close();
Also I am getting this exception whenever I run the program.
Exception in thread "main" java.io.EOFException: Unexpected end of ZLIB input stream
     at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:216)
     at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:134)
     at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:87)
     at java.io.FilterInputStream.read(FilterInputStream.java:90)
at service.RetrieveFile.main(RetrieveFile.java:93)

Hey guys,
Thanks for your help. The problem was in writing to the database. Eventhough I closed all the input and output streams, I didn't flush the output stream and close it immediately. So now its working and thanks again for the great help.

Similar Messages

  • I am unable to view google ads running alongside and under videos on YouTube. This is only a problem when I use Firefox. If I use another browser, I can see the ads. I do not have adlock as it does not appear in my plug-ins/add ons. Please help..

    I have been using Firefox for about two years. For about a month now I have been unable to view any Google advertisements that run on YouTube pages alongside and under videos. This is important for my business. I would like to stay with Firefox, but this is only a problem when I use Firefox and is not a problem with Internet Explorer or Google Chrome as I checked. I tried uninstalling Firefox and all plugs ins and add ons and then reinstalling it. This did not work. Firefox seems to be blocking the Google codes that enable the ads to run on the pages. I look forward to your help. Thank you.

    CS2 is very old and reached its "end of life" a while back.  So probably won't run on modern operating systems.  If you can still run it, you'll need to uninstall what you have and re-install with the download link below to activate it.
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Nancy O.

  • Hi! Has anybody succeeded in using Presonus Audio box 22 vsl with Os Mountain Lion? They doesn´t seem to connect. No problems when i used with Snow Leopard. I upgraded: Now is Kreonika not happy. Not happy at all!

    Hi! Has anybody succeeded in using Presonus Audio box 22 vsl with Os Mountain Lion? They doesn´t seem to connect.
    No problems when i used with Snow Leopard. I upgraded: Now Kreonika is not happy. Not happy at all!

    In cases like this, if you have an Apple store near by, they will most likely install the OS free of charge for you, if you can't bring your Apple ID along to prove you've paid for it.
    Would that work out for you?

  • 1. The procedure called by CUSTOM.pll causes the problem when we use f60gen

    When CUSTOM.pll contains a call to a package that in turn calls a remote package, the CUSTOM.pll compile hangs forever.
    1. The procedure called by CUSTOM.pll causes the problem when we use f60gen. Though same procedure compiles successfully using "alter procedure compile" command.
    2. We have observed the problem happens due to synonym present on the remote database(db link).
    It doesn’t work if you are calling SYNONYM on remote database. It works, for calls to tables or procedures or packages in remote database if that object is OWNED DIRECTLY by the account to which dblink is connecting to.
    select object_name, object_type from user_objects@NH_SCM_ICE.DB.ATT.COM ;
    OBJECT_NAME OBJECT_TYPE
    FA_LOCATIONS SYNONYM
    FND_FLEX_VALUES SYNONYM

    The database link is created under the APPS user in the local database but connects to a different user (SWCS_ICE_SUPCHAIN) in the remote database.
    The user in the remote database does not own any objects. It only has synonyms to objects owned by apps and others.
    Incidentally, the hang also happens when trying to describe the remote package from the application tier (8.0.6.3 sqlplus) but the describe works fine from the DB tier (10gR2 sqlplus).

  • I have a problem when I use the headphone. Music starts immediately and Siri starts as well

    I have a problem when I use the headphone. Music starts immediately and Siri starts as well

    I am having this issue also. It started after I downloaded You Tube apps.

  • I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication

    I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication.
    I use LabVIEW to read the data from serial communication then, i open the example (.vi) from Serial Communication - Advanced Serial Write and Read  from LabVIEW Example. BUT it have some error message that : Error - 1073807202 occured  at property node in visa configure serial port (instr).vi -> advance serial write and read .vi
    this error code is undefined. no one has provide a description for this code, or you might have wired a number that is not an error code to the error code input.
    I don't know why? please help me. thank you.

    When I copy that code into "Explain Error" I get: "VISA:  (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded."
    You may have a bad install of VISA or the wrong version of VISA loaded. Try re-installing VISA. You can get the latest version from the NI support site: http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=1....
    Also ensure that you are not pointing the example towards a serial port that does not exist.
    Please let us know what you find and what gets this working for you.
         Rob

  • Dear Apple,  I have a problem when I use "iTunes Gift Card" to shop in a game which is called "Puzzle

    Dear Apple,
    I have a problem when I use "iTunes Gift Card" to shop in a game which is called "Puzzle & Dragons"(パズル&ドラゴンズ). I cannot buy anything in the game and the system shows the following message: "please contact itunes support to complete this transaction".
    Could you help me to solve the problem? Thank you very much!
    Best Regards,
    tat

    Click here and request assistance.
    (79862)

  • Problem when printing " " using XSL

    I have a problem when printing the "<" .It is always printed as
    "&#60;" in the HTML file.
    I wish to transfer a Javascript text . I tried
    using CDATA . This is an extract of a portion in my XSL File
    which uses CDATA.
    <![CDATA[
    function createLOV(lov_name, array_touse) {
    document.writeln("<select name='" + lov_name + "'>");
    for (var i=0; i < array_touse.length; i++) {
    document.writeln("<option value='" + array_touse[i] + "'>" +
    array_touse[i] + "</option>");
    }]]>
    And this is what the HTML file contains
    function createLOV(lov_name, array_touse) {
    document.writeln("&#60;select name='" + lov_name + "'>");
    for (var i=0; i &#60; array_touse.length; i++) {
    document.writeln("&#60;option value='" + array_touse[i] + "'>" +
    array_touse[i] + "&#60;/option>"); }
    document.writeln("&#60;/select>");}
    I tried using the <xsl:text disable-output-escaping="yes"> but in
    vain.
    If i use < or &x3C; , i still get &#60; in the HTML file.
    How do I solve this problem. I'm using XSQL Servlet with JSDK2.1
    both running on Sun Solaris2.6 .
    Thanks in advance,
    Suresh
    null

    Suresh Seetharam (guest) wrote:
    : I have a problem when printing the "<" .It is always printed
    as
    : "&#60;" in the HTML file.
    : I wish to transfer a Javascript text . I tried
    : using CDATA . This is an extract of a portion in my XSL File
    : which uses CDATA.
    : <![CDATA[
    : function createLOV(lov_name, array_touse) {
    : document.writeln("<select name='" + lov_name + "'>");
    : for (var i=0; i < array_touse.length; i++) {
    : document.writeln("<option value='" + array_touse[i] + "'>" +
    : array_touse[i] + "</option>");
    : }]]>
    : And this is what the HTML file contains
    : function createLOV(lov_name, array_touse) {
    : document.writeln("&#60;select name='" + lov_name + "'>");
    : for (var i=0; i &#60; array_touse.length; i++) {
    : document.writeln("&#60;option value='" + array_touse[i] + "'>"
    +
    : array_touse[i] + "&#60;/option>"); }
    : document.writeln("&#60;/select>");}
    : I tried using the <xsl:text disable-output-escaping="yes"> but
    in
    : vain.
    : If i use < or &x3C; , i still get &#60; in the HTML file.
    : How do I solve this problem. I'm using XSQL Servlet with
    JSDK2.1
    : both running on Sun Solaris2.6 .
    : Thanks in advance,
    : Suresh
    Currently, the parser does not support the xsl:output and
    output-escaping mechanisms. We plan on adding support for this
    in a future release.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Problem when login using EAP

    i'am using ACS and cisco 3600 to perform wireless mobility using GPRS.
    now i'm having a problem when one of my GPRS scanner (Fujitsu) can't access to ACS using EAP.
    that GPRS scanner must used PAP to access to ACS.
    But, my other GPRS Scanner (Symbol) can access.
    please advice

    i'am using ACS and cisco 3600 to perform wireless mobility using GPRS.
    now i'm having a problem when one of my GPRS scanner (Fujitsu) can't access to ACS using EAP.
    that GPRS scanner must used PAP to access to ACS.
    But, my other GPRS Scanner (Symbol) can access.
    please advice

  • When I am in aol email I can't get to my contact list to forward my email. I have no problem when I use Internet Explorer for aol email.

    When I'm in Firefox and try to forward an email in aol email I cannot access my contact list when I click on the to/bcc/cc . When I use Internet Explorer I have no problem accessing my contact list at all.

    First make sure Settings > Facebook > Contacts is turned off. Tis might be different from what you described in your question.
    Then open your Contacts app and check carefully what is there for your son and grand daughter's contact info. Correct if necessary.

  • Premiere cs4 exporting audio problem when I use desktop editing mode

    Hi.... I recently use a desktop editing mode when I create my new sequence ! I have a 480X270 16/9 ratio.... so when I export my sequence FLV in encoder... everything is ok for audio setting ... but when I put my movie on the Internet or just playback in adobe media player, I have no sound !!!! I don't know what is the problem....
    Thanks for help me !!!!

    Thanks for your quick respond and support !!!!!
    1- multiplexing = FLV
    2- audio default : codec mpeg layer III
    3 - i'm on pc
    4 - I use a jcplayer for my website and in local playback i use adobe media player
    I think that everything was ok in audio setting if i see my setting, but when i use a default sequence setting and I export I have sound.... when i use desktop sequence setting i lost my sound when i export !!!!!!
    is very strange !!!!
    Thanks again

  • I have a problem when i use fetch LAZY

    Hi All
    i have faced a problem when i have tried FETCH LAZY instead of FETCH EAGER
    The problem is the table generator return null instead of valid primary key value
    I dont get what is the problem every thing is ok With the FETCH EAGER
    please help me in this problem either by give me a directions to solve this problem or give me an example about FETCH LAZY
    Hassan Kbbewar.

    i need a complete example of ejb with fetch lazy relationship ...

  • Having audio problems when I use Facetime, any ideas?

    When I use Facetime on my 4S, the video shows & I can hear the person on the call but they cannot hear me!

    try rebooting
    hold down the home and power buttons untill the apple appears

  • Occurs the problem when i use bapi BAPI_SALESORDER_CREATEFROMDAT2

    hi:
    the first time a salesorder can be creat successfully,
    but when i used it again in a short time ,system will give out a RUNTIME ERROR 'PXA_NO_FREE_SPACE'.
    >> Short dump has not been completely stored. It is too big.
    No PXA storage space available at the moment.
    <b>What happened?</b>
    The current ABAP/4 program had to be terminated because there
    was no space available to load it.
    Each ABAP/4 program to be executed is stored in a central
    storage area that is divided between all users.
    This area was too small to hold all currently active programs for all
    users.
    The current program, "SAPLV05E ", had to be terminated because a capacity limit
    has been reached.

    See the following example:
    REPORT  ZSALESORDER.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d .
    SELECTION-SCREEN END OF LINE.
    Complete Deliver
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text10 FOR FIELD p_autlf.
    PARAMETERS: p_autlf TYPE autlf DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    DATA: lt_schedules_ink    TYPE STANDARD TABLE OF bapisdhead1
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    v_text10 = 'Complete delivery'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    *Complete delivery
        header-COMPL_DLV = p_autlf.
        header-COMPL_DLV = 'X'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
    item category
      itemx-ITEM_CATEG = 'X'.
      APPEND item.
      APPEND itemx.
      ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000020'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000020'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000020'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.

  • There are some strange problems when i used swc files in my as3 project

    Hello everyone,
            My development environment:  fdk4.0,  flash cs5.5,  I publish fla file by using flash cs5.5,   publish setting is  fp version :10.0&10.1 ->swc. I imported swc files to my as3 project and  complied them by using flex sdk4.0. When i run my project,fp was crash.   when i republished on fp 10.2, the project works. Is there any reason?
            another strange problem, for example   a MovieClip's aslink named "A" in swc, it has a textfield named "subText".  I write code like below:
                            var mc:A = new A();
                            mc.subText.text = "test";  
             when mc called "subText" , fp throws null property error, it can't find  subText..  very small number of movieclips have this problem,  I sloved this by duplicating a new one and rename it.
             but i don't  know why ? 
              thank you for your reply.

    I should have figured that out from your original post. I think there is a possibility that your bookmarks/history database (places.sqlite) has a corrupted record. Rather than take drastic action on that immediately, could you do a test? The test is to exit Firefox, rename your existing database, and restart Firefox. Firefox should import your last bookmarks backup. You then could check whether the problem remains or whether you got a clean restore of bookmarks. After the test, assuming you prefer to retain your history, you could undo the procedure and try restoring your bookmark backup into the database to see whether that overwrites the problem record. If not, then we would go back to possible drastic action.
    '''Test procedure''':
    Open your current Firefox settings (AKA Firefox profile) folder using
    Help > Troubleshooting Information > "Show Folder" button
    Switch back to Firefox and Exit
    Pause while Firefox finishes its cleanup, then rename '''places.sqlite''' to something like places_20130614.sqlite. Keep this window open.
    Restart Firefox. By design, Firefox should import your last automatic bookmark backup.
    If you return to the Library dialog, how does it look?
    '''To reverse the test''' (but preserve a backup of your history/bookmark database):
    Exit Firefox
    Delete the newly created places.sqlite file
    Right-click copy and paste the places_20130614.sqlite and rename the copy to places.sqlite
    Restart Firefox and open the Library dialog. Should look like it did a few minutes ago before any changes.
    ''If the test showed no corruption,'' try to restore your last bookmarks backup. The procedure is described in this article: [[Restore bookmarks from backup or move them to another computer]].
    Does any of that get us closer to a solution?

Maybe you are looking for