Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET BWT and BZip2 options for QuickCompression

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20103 |

    I’d like to know if BWT and BZIP2 CompressionMethods are available for QuickCompression. When I use CompressionMethod.BWT or CompressionMethod.Bzip2 the program says: “An attempt was made to use an unsupported compression method.”

     If these are not available for Quickcompression, I would be very happy if anybody gives me a piece of code on how I can use these methods to compress byte arrays in memory.

     Thanks 

    Imported from legacy forums. Posted by Talat (had 2159 views)

    User (Old forums)
    Member
    Post count: 23064

    QuickCompression does not support methods other than Stored, Deflated, Deflated64.

    You can use a compression stream to do what you want.

    e.g.:

    using( FileStream dest = new FileStream( @”D:\Temp\BwtCompression.txt”, FileMode.Create ) )

    {

        using( CompressedStream compStream = new CompressedStream( dest, CompressionMethod.BWT, CompressionLevel.Normal ) )

        {

            using( FileStream source = new FileStream( @”D:\Temp\source.txt”, FileMode.Open ) )

            {

                byte[] buffer = new byte[ 1000 ];

                int bytesRead = 0;

                while( ( bytesRead = source.Read( buffer, 0, buffer.Length ) ) > 0 )

                {

                    compStream.Write( buffer, 0, bytesRead );

                }

            }

        }

    }

    Imported from legacy forums. Posted by André (had 2642 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.