Beispiel #1
0
            public static MutableString SetDictionary(Inflate/*!*/ self, [NotNull]MutableString/*!*/ dictionary)
            {
                byte[] buffer = dictionary.ToByteArray();
                var zst = self.GetStream();
                int err = zst.inflateSetDictionary(buffer, buffer.Length);
                if (err != Z_OK) {
                    throw MakeError(err, zst.msg);
                }

                return dictionary;
            }
Beispiel #2
0
            public static MutableString InflateString(Inflate/*!*/ self, [DefaultProtocol]MutableString str)
            {
                MutableString uncompressed;

                var zst = self.GetStream();
                int result = Process(zst, str, zlib.FlushStrategy.Z_SYNC_FLUSH, decompress, out uncompressed, ref self.trailingUncompressedData);
                if (result != Z_OK && result != Z_STREAM_END) {
                    throw MakeError(result, zst.msg);
                }

                return uncompressed;
            }