Esempio n. 1
0
            public ErrorCode Inflate(FlushCode flush)
            {
                EnsureNotDisposed();
                EnsureState(State.InitializedForInflate);

                return(NativeZLibDLLStub.inflateDelegate(zStreamPtr, flush));
            }
Esempio n. 2
0
            public ErrorCode Deflate(FlushCode flush)
            {
                EnsureNotDisposed();
                EnsureState(State.InitializedForDeflate);

                return(NativeZLibDLLStub.deflateDelegate(ref zStream, flush));
            }
Esempio n. 3
0
            public ErrorCode Inflate(FlushCode flush)
            {
                EnsureNotDisposed();
                EnsureState(State.InitializedForInflate);

                return(ZLibInterop.Inflate(ref _zStream, flush));
            }
Esempio n. 4
0
            public unsafe ErrorCode Inflate(FlushCode flush)
            {
                EnsureNotDisposed();
                EnsureState(State.InitializedForInflate);

                fixed(ZStream *stream = &_zStream)
                {
                    return(Interop.ZLib.Inflate(stream, flush));
                }
            }
Esempio n. 5
0
        private static ErrorCode Deflate(ZLibStreamHandle stream, FlushCode flushCode)
        {
            ErrorCode errorCode = stream.Deflate(flushCode);

            if (errorCode is ErrorCode.Ok or ErrorCode.StreamEnd or ErrorCode.BufError)
            {
                return(errorCode);
            }

            string message = errorCode == ErrorCode.StreamError
                ? SR.ZLibErrorInconsistentStream
                : string.Format(SR.ZLibErrorUnexpected, (int)errorCode);

            throw new WebSocketException(message);
        }
Esempio n. 6
0
 public ErrorCode Deflate(FlushCode flush)
 {
     EnsureNotDisposed();
     EnsureState(State.InitializedForDeflate);
     return(Interop.zlib.Deflate(ref _zStream, flush));
 }
Esempio n. 7
0
 public ErrorCode Inflate(FlushCode flush)
 {
     EnsureNotDisposed();
     EnsureState(State.InitializedForInflate);
     return Interop.zlib.Inflate(ref _zStream, flush);
 }