I'm trying to decompress a stream from a PDF Object in this file:
4 0 obj
<<
/Filter /FlateDecode
/Length 64
>>
stream
x?s
QDw34V02UIS0′0P030PIQDpé?KIUH-.ITH.-*ê··×TéRp
á T‰
ê
endstream
endobj
I have this stream copy-pasted with the same format as in the original file in a file called Stream.file
x?s
QDw34V02UIS0′0P030PIQDpé?KIUH-.ITH.-*ê··×TéRp
á T‰
ê
This stream should translate to: Donde esta curro??
. Added that stream to a Stream.file
in a C# Console application.
using System.IO;
using System.IO.Compression;
namespace Filters
{
public static class FiltersLoader
{
public static void Parse()
{
var bytes = File.ReadAllBytes("Stream.file");
var originalFileStream = new MemoryStream(bytes);
using (var decompressedFileStream = new MemoryStream())
using (var decompressionStream = new DeflateStream(originalFileStream, CompressionMode.Decompress))
{
decompressionStream.CopyTo(decompressedFileStream);
}
}
}
}
However it yields an exception whil trying to copy it:
The archive entry was compressed using an unsupported compression method.
I'd like how to decode this stream with .net code if it's possible.
Thanks.
See Question&Answers more detail:os