Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Expected end of stream not found

Sort Posts: Previous Next
  •  06-13-2008, 2:11 AM Post no. 12928

    Expected end of stream not found

    Hi all, 

    I am trying to compress all files from folder into oe xml file and retrive them back.

    I did it successfully with English OS but i got exception "Expected end of stream not found" when irun same code on Japanese and Chinese OS.

    The code is as follows :

    byte[] compressedData = Encoding.Default.GetBytes(strData);

    byte[] decompressedData;

    try

    {

    decompressedData = QuickCompression.Decompress(compressedData);

    }

    catch(Exception e)

    {

    sw.WriteLine(e.Message);

    sw.Close();

    RevertImportOperation();

    return 2;

    }

    some times if it do not give any exception but I can not retrieve Chinese(chn) and Japanese(jpn) char. Instead of the I get ????? characters. I there is some problem with Unicode string. we are passing byte array to the method and some times jpn and chn char are 2 byes. This might be causing problem.

     I tried using sample code given in documentation which uses MemoryStream and CompressedStream for compression and decompression but I got another exception.

     Can any one suggest me what i need to do to support Unicode compression and decompression? Any other method from zip lib?

    Thanks and Regards,

     

    Trupti Somwanshi

    Software Engineer | Persistent Systems Limited

    trupti_somwanshi@persistent.co.in

    Persistent Systems - Innovation in software product design, development and delivery -  www.persistentsys.com

     

     

  •  06-13-2008, 2:47 PM Post no. 12955 in reply to 12928

    Re: Expected end of stream not found

    Have you tried to use Unicode encoding instead of the Default, which may well be ASCII?

     e.g. :

    Encoding.Unicode.GetBytes(strData);

    instead of : 

    Encoding.Default.GetBytes(strData);


    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  06-18-2008, 3:21 AM Post no. 13042 in reply to 12955

    Re: Expected end of stream not found

    Thank yo very much for your reply and suggestion.

    Yes I have tried using Unicode. Still I got exception. Even I have tried using UTF7,UTF8 and ASCII.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.