Questions tagged [deflatestream]

Microsoft .NET built-in support for standards-compliant Deflate algorithm (compress and decompress).

DeflateStream is a Microsoft .NET Class that provides standards-compliant support for the "DEFLATE" compression algorithm.

78 questions
1
vote
1 answer

How can I use the DeflateStream class on one line in a file?

I have a file which contains plaintext mixed in with some compressed text, for example: Version 01 Maker SomeCompany l 73 mark h�22V0P���w�/�+Q0���L)�66□ // This line was compressed using DeflateZLib endmark It seems that Microsoft has a solution,…
michael
  • 14,844
  • 28
  • 89
  • 177
1
vote
1 answer

.NET DeflateStream Usage

I am trying to utilize the INFLATE compression stream in .NET using a DeflateStream. My code throws an InvalidDataException although I know that the data I am passing has been correctly processed by the DEFLATE algorithm (it has been tested). Am I…
cytinus
  • 5,467
  • 8
  • 36
  • 47
0
votes
1 answer

deflate stream result is disappointing , is it normal?

I'm trying to compress image files to send it via network , here is my test compress method public void compress(MemoryStream inStream) { using (MemoryStream outStream = new MemoryStream()) { using (DeflateStream…
Musaab
  • 805
  • 2
  • 13
  • 30
0
votes
1 answer

C# compression and Delphi decompression

I've some files that were compressed using the C# DeflateStream class like this: using (DeflateStream compressionStream = new DeflateStream(compressedFileStream, CompressionMode.Compress)) Nothing fancy, all default values. It decompresses fine…
Petey
  • 49
  • 3
0
votes
1 answer

Unable to resolve compression, encryption, decryption, decompression stream implementation

I've been fighting with chained using statements, and am unable to resolve the latest in a long line of implementation issues. I need to compress, then encrypt and append the generated IV to the selected file. This all appears to work correctly,…
Reahreic
  • 596
  • 2
  • 7
  • 26
0
votes
0 answers

C# Ionic.Zlib Decompress and Compress different

Summary: when doing var x = decompress(input); var ouput = compress(x); using the same DeflateStream and CompressionLevel the result for input==output equals false.. Why? I am working on editing some Age of Empire 2 maps. I tried to copy as much…
Daan Goumans
  • 65
  • 1
  • 10
0
votes
0 answers

How to compress a bitmap in c#

I have a code that takes a screenshot and I need to compress it in order to send it. The following code converts a Bitmap into a stream and compresses it. My problem is that the compression outcome is always a byte array full of zeros (in this case…
Anna
  • 1
  • 4
0
votes
1 answer

Java - How to compress using deflater with dynamic byte size

How to compress byte array using deflater? I tried with deflate inflate example from Oracle page. It worked fine. My doubt is how to make byte[] size dynamic.? And how to calculate before and after compression of byte[]?
user10386436
0
votes
1 answer

Error while trying to decompress stream in PDF

I'm trying to decompress a stream from a PDF Object in this file: 4 0 obj << /Filter /FlateDecode /Length 64 >> stream xœs QÐw34V02UIS0´0P030PIQÐpÉÏKIUH-.ITH.-*Ê··×TÉRp á T‰ Ê endstream endobj I have this stream copy-pasted with the same format…
Fritjof Berggren
  • 3,178
  • 5
  • 35
  • 57
0
votes
1 answer

Set Block Blob Content From Stream

Set-AzStorageBlobContent takes a file location to be uploaded to cloud. is there way I can pass a System.IO.Stream to a Block Blob in PowerShell?
Murali
  • 21
  • 5
0
votes
2 answers

MSDN C# DeflateStream sample code issue

Any ideas why in the below sample, we need to add 100 (buffer.Length + 100)? buffer.Length should be the same as decompressed buffer length, so no need to add 100 more. :-) http://msdn.microsoft.com/en-us/library/bc2dbwea.aspx thanks in…
George2
  • 44,761
  • 110
  • 317
  • 455
0
votes
0 answers

Sending DeflateStream file contents to Azure Message Queue

This is about sending/receiving contents of an XML file to/from Azure Service Message Queue using TopicClient in C#. I am sending contents of a XML file as string, I can see the message on the Azure Queue and can even read its contents properly, so…
Timmy
  • 1
  • 2
0
votes
1 answer

Using GZIP compression stream in android

I want to compress data in android devices and send it to an ASP.net server-side, but I don't want to consume much power and sacrifice device resources. I've tried compressing data using Deflate stream on android-side and decompressing using the…
A.J
  • 333
  • 1
  • 2
  • 15
0
votes
1 answer

Decompress and Compress back does not return the same content

Why don't I get the same content after decompressing and compressing-back a byte-array with DeflateStream? The code: byte[] originalcontent = Same Byte Array Content byte[] decompressedBytes; byte[] compressedBackBytes; // Decompress the original…
Roi Bar
  • 105
  • 11
0
votes
1 answer

Compression/Decompression for DataSet or any .Net Object

I'm developing a WPF App, in which I want to encrypt and compress heavy DataSet or Objects (<2MB) and send it across over the network. The other party would decompress and decrypt the data and consume it. This process will be on both sides from…
Varun Jain
  • 1,015
  • 2
  • 13
  • 19