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

◆ CreateInflater()

ZLibNative.ZLibStreamHandle System.Net.WebSockets.Compression.WebSocketInflater.CreateInflater ( )
inlineprivate

Definition at line 200 of file WebSocketInflater.cs.

201 {
202 ZLibNative.ErrorCode errorCode;
203 ZLibNative.ZLibStreamHandle zLibStreamHandle;
204 try
205 {
206 errorCode = ZLibNative.CreateZLibStreamForInflate(out zLibStreamHandle, _windowBits);
207 }
208 catch (Exception innerException)
209 {
210 throw new WebSocketException(System.SR.ZLibErrorDLLLoadError, innerException);
211 }
212 if (errorCode == ZLibNative.ErrorCode.Ok)
213 {
214 return zLibStreamHandle;
215 }
216 zLibStreamHandle.Dispose();
217 string message = ((errorCode == ZLibNative.ErrorCode.MemError) ? System.SR.ZLibErrorNotEnoughMemory : string.Format(System.SR.ZLibErrorUnexpected, (int)errorCode));
218 throw new WebSocketException(message);
219 }
static ErrorCode CreateZLibStreamForInflate(out ZLibStreamHandle zLibStreamHandle, int windowBits)
static string ZLibErrorNotEnoughMemory
Definition SR.cs:46
static string ZLibErrorDLLLoadError
Definition SR.cs:40
Definition SR.cs:7

References System.Net.WebSockets.Compression.WebSocketInflater._windowBits, System.IO.Compression.ZLibNative.CreateZLibStreamForInflate(), System.Runtime.InteropServices.SafeHandle.Dispose(), System.SR.ZLibErrorDLLLoadError, System.SR.ZLibErrorNotEnoughMemory, and System.SR.ZLibErrorUnexpected.

Referenced by System.Net.WebSockets.Compression.WebSocketInflater.Inflate().