in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

exception

Last post 03-06-2008 9:50 AM by C1_JohnAd. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-13-2007 12:18 PM

    exception

    Hi there,

    I am using C1.C1Zip.dll Build Number 1.1.20043.30  Build Date: April 19, 2004. on .Net 2003 C# projeect and during the compression it throws exception. It seems it's over the size limitation.

    Here is my code:

    ============================== 

    //Compress Raw Data

    System.IO.MemoryStream compressedMS = new System.IO.MemoryStream();

    C1.C1Zip.C1ZStreamWriter compressedZIPSW = new C1.C1Zip.C1ZStreamWriter(compressedMS);

    System.IO.BinaryWriter compressedBW = new System.IO.BinaryWriter(compressedZIPSW);

     

    //Write # of elements

    compressedBW.Write (this.Logger[i].rawDataSet.Count);

    //Write elements themselves

    for (int x=0;x<this.Logger[i].rawDataSet.Count; x++,offset++)

    {

    compressedBW.Write((
    ushort)this.Logger[i].rawDataSet[x]);

    }

    =======================================

    when x is about 17000000, it throws exception. I have verified my data array this.Logger[i].rawDataSet is valid by successfully writing them to a file.

    This only happens if the data value in rawDataSet array varies a lot. if they do not change a lot I can pass that point.

    Any idea?

    Thanks!

    Stephen

  • 03-06-2008 9:50 AM In reply to

    Re: exception

    Hi Stephen,
     
    In regards to your to you query I would suggest you to instantiate C1ZStreamWriter with two arguments and the second argument set to either BestCompression or BestSpeed.
     
    Like the following

    C1.C1Zip.C1ZStreamWriter compressedZIPSW = new C1.C1Zip.C1ZStreamWriter(compressedMS,C1.C1Zip.CompressionLevelEnum.BestCompression);

    I hope this would help you.
     
    Regards,
    John Adams
     

    Hi there,

    I am using C1.C1Zip.dll Build Number 1.1.20043.30  Build Date: April 19, 2004. on .Net 2003 C# projeect and during the compression it throws exception. It seems it's over the size limitation.

    Here is my code:

    ============================== 

    //Compress Raw Data

    System.IO.MemoryStream compressedMS = new System.IO.MemoryStream();

    C1.C1Zip.C1ZStreamWriter compressedZIPSW = new C1.C1Zip.C1ZStreamWriter(compressedMS);

    System.IO.BinaryWriter compressedBW = new System.IO.BinaryWriter(compressedZIPSW);

     

    //Write # of elements

    compressedBW.Write (this.Logger[i].rawDataSet.Count);

    //Write elements themselves

    for (int x=0;x<this.Logger[i].rawDataSet.Count; x++,offset++)

    {

    compressedBW.Write((
    ushort)this.Logger[i].rawDataSet[x]);

    }

    =======================================

    when x is about 17000000, it throws exception. I have verified my data array this.Logger[i].rawDataSet is valid by successfully writing them to a file.

    This only happens if the data value in rawDataSet array varies a lot. if they do not change a lot I can pass that point.

    Any idea?

    Thanks!

    Stephen



    http://helpcentral.componentone.com/cs/forums/p/73550/199667.aspx#199667

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.