Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Deflate() [2/2]

static ZLibNative.ErrorCode System.Net.WebSockets.Compression.WebSocketDeflater.Deflate ( ZLibNative::ZLibStreamHandle stream,
ZLibNative::FlushCode flushCode )
inlinestaticprivate

Definition at line 133 of file WebSocketDeflater.cs.

134 {
135 ZLibNative.ErrorCode errorCode = stream.Deflate(flushCode);
136 string text;
137 switch (errorCode)
138 {
139 case ZLibNative.ErrorCode.BufError:
140 case ZLibNative.ErrorCode.Ok:
141 case ZLibNative.ErrorCode.StreamEnd:
142 return errorCode;
143 default:
144 text = string.Format(System.SR.ZLibErrorUnexpected, (int)errorCode);
145 break;
146 case ZLibNative.ErrorCode.StreamError:
148 break;
149 }
150 string message = text;
151 throw new WebSocketException(message);
152 }
static string ZLibErrorInconsistentStream
Definition SR.cs:42
static string ZLibErrorUnexpected
Definition SR.cs:50
Definition SR.cs:7

References System.stream, System.text, System.SR.ZLibErrorInconsistentStream, and System.SR.ZLibErrorUnexpected.