Exemple #1
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);
        }
Exemple #2
0
 public static ErrorCode CreateZLibStreamForInflate(out ZLibStreamHandle zLibStreamHandle, int windowBits)
 {
     zLibStreamHandle = new ZLibStreamHandle();
     return(zLibStreamHandle.InflateInit2_(windowBits));
 }
Exemple #3
0
 public static ErrorCode CreateZLibStreamForDeflate(out ZLibStreamHandle zLibStreamHandle,
                                                    CompressionLevel level, int windowBits, int memLevel, CompressionStrategy strategy)
 {
     zLibStreamHandle = new ZLibStreamHandle();
     return(zLibStreamHandle.DeflateInit2_(level, windowBits, memLevel, strategy));
 }
Exemple #4
0
 public static Int32 ZLibCompileFlags()
 {
     return(ZLibStreamHandle.ZLibCompileFlags());
 }
Exemple #5
0
 public static ErrorCode CreateZLibStreamForInflate(out ZLibStreamHandle zLibStreamHandle)
 {
     return(CreateZLibStreamForInflate(out zLibStreamHandle, Deflate_DefaultWindowBits));
 }
Exemple #6
0
 public static ErrorCode CreateZLibStreamForDeflate(out ZLibStreamHandle zLibStreamHandle)
 {
     return(CreateZLibStreamForDeflate(out zLibStreamHandle,
                                       CompressionLevel.DefaultCompression, Deflate_DefaultWindowBits,
                                       Deflate_DefaultMemLevel, CompressionStrategy.DefaultStrategy));
 }
Exemple #7
0
 public static ErrorCode CreateZLibStreamForInflate(out ZLibStreamHandle zLibStreamHandle, int windowBits)
 {
     zLibStreamHandle = new ZLibStreamHandle();
     return zLibStreamHandle.InflateInit2_(windowBits);
 }
Exemple #8
0
 public static ErrorCode CreateZLibStreamForDeflate(out ZLibStreamHandle zLibStreamHandle,
                                                    CompressionLevel level, int windowBits, int memLevel, CompressionStrategy strategy)
 {
     zLibStreamHandle = new ZLibStreamHandle();
     return zLibStreamHandle.DeflateInit2_(level, windowBits, memLevel, strategy);
 }
Exemple #9
0
 public static ErrorCode CreateZLibStreamForInflate(out ZLibStreamHandle zLibStreamHandle)
 {
     return CreateZLibStreamForInflate(out zLibStreamHandle, Deflate_DefaultWindowBits);
 }
Exemple #10
0
 public static ErrorCode CreateZLibStreamForDeflate(out ZLibStreamHandle zLibStreamHandle)
 {
     return CreateZLibStreamForDeflate(out zLibStreamHandle,
                                       CompressionLevel.DefaultCompression, Deflate_DefaultWindowBits,
                                       Deflate_DefaultMemLevel, CompressionStrategy.DefaultStrategy);
 }