예제 #1
0
파일: zlib.cs 프로젝트: TerabyteX/main
            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;
            }
예제 #2
0
파일: zlib.cs 프로젝트: TerabyteX/main
            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;
            }