Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8139693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:54:55+00:00 2026-06-06T11:54:55+00:00

I’ve been working on a function parsing 3rd party fms logs. The logs are

  • 0

I’ve been working on a function parsing 3rd party fms logs. The logs are in Gzip, so I use a decompressing function that works for any other Gzip files we use.

When decompressing these files I only get the first line of the compressed file, there’s no exception, it just doesn’t find the rest of the bytes as if there’s an EOF at the first line.
I tried using Ionic.Zlib instead of System.IO.Compression but the result was the same. The files don’t seem to be corrupted in any way, decompressing them with Winrar works.

If anybody has any idea of how to solve this, I’ll appreciate your help.
Thanks

You can download a sample file here:
http://www.adjustyourset.tv/fms_6F9E_20120621_0001.log.gz

This is my decompression function:

    public static bool DecompressGZip(String fileRoot, String destRoot)
    {
        try
        {
            using (FileStream fileStram = new FileStream(fileRoot, FileMode.Open, FileAccess.Read))
            {
                using (FileStream fOutStream = new FileStream(destRoot, FileMode.Create, FileAccess.Write))
                {
                    using (GZipStream zipStream = new GZipStream(fileStram, CompressionMode.Decompress, true))
                    {
                        byte[] buffer = new byte[4096];
                        int numRead;

                        while ((numRead = zipStream.Read(buffer, 0, buffer.Length)) != 0)
                        {
                            fOutStream.Write(buffer, 0, numRead);
                        }
                        return true;
                    }
                }

            }
        }
        catch (Exception ex)
        {
            LogUtils.SaveToLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "Eror decompressing " + fileRoot + " : " + ex.Message, Constants.systemLog, 209715200, 6);
            return false;
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:55:01+00:00Added an answer on June 6, 2026 at 11:55 am

    I’ve put the last 45 minutes wrapping my head around this problem but I just can’t explain why it isn’t working. Somehow the DeflateStream-class isn’t decoding your data properly. I wrote up my own GZip-parser (I can share the code if anyone wants to check it) which reads all the headers and checks them for validity (to make sure that there are no funny stuff there) and then use DeflateStream to inflate the actual data but with your file it still just gets me the first line.

    If I recompress using your logfile using GZipStream (after first decompressing it with winrar) then it is decompressed just fine again both my my own parser and your own sample.

    There seems to be some critizism on the net about Microsofts implementation of Deflate (http://www.virtualdub.org/blog/pivot/entry.php?id=335) so it might be that you found one of it’s quirks.

    However, a simple solution to your problem is to switch to SharZipLib (http://www.icsharpcode.net/opensource/sharpziplib/), I tried it out and it can decompress your file just fine.

        public static void DecompressGZip(String fileRoot, String destRoot)
        {
            using (FileStream fileStram = new FileStream(fileRoot, FileMode.Open, FileAccess.Read))
            using (GZipInputStream zipStream = new GZipInputStream(fileStram))
            using (StreamReader sr = new StreamReader(zipStream))
            {
                string data = sr.ReadToEnd();
                File.WriteAllText(destRoot, data);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on a school assignment that makes pretty heavy use of vectors,
I.ve been working all night to get this function to work, but i'm too
Alright have been working to switch to jQuery 1.7's new and improved .on() function
i been working in the login code .. it works fine except this message
I've been working with a ton of other's JS recently, and am starting to
I've been writing some templates that expect to be passed a boost::function. They determine
I have been working on some code that is similar to the following: typedef
I've recently been working on a vCard parser that opens a vCard file and
I've been working on a gadget that will run in iGoogle. In fact, it's
I've been working on text parsing task when I found strange Postgres behavior. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.