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

◆ Inflate() [4/4]

ZLibNative.ErrorCode System.IO.Compression.Inflater.Inflate ( ZLibNative::FlushCode flushCode)
inlineprivate

Definition at line 240 of file Inflater.cs.

241 {
242 ZLibNative.ErrorCode errorCode;
243 try
244 {
245 errorCode = _zlibStream.Inflate(flushCode);
246 }
247 catch (Exception innerException)
248 {
249 throw new ZLibException(System.SR.ZLibErrorDLLLoadError, innerException);
250 }
251 switch (errorCode)
252 {
253 case ZLibNative.ErrorCode.Ok:
254 case ZLibNative.ErrorCode.StreamEnd:
255 return errorCode;
256 case ZLibNative.ErrorCode.BufError:
257 return errorCode;
258 case ZLibNative.ErrorCode.MemError:
259 throw new ZLibException(System.SR.ZLibErrorNotEnoughMemory, "inflate_", (int)errorCode, _zlibStream.GetErrorMessage());
260 case ZLibNative.ErrorCode.DataError:
261 throw new InvalidDataException(System.SR.UnsupportedCompression);
262 case ZLibNative.ErrorCode.StreamError:
263 throw new ZLibException(System.SR.ZLibErrorInconsistentStream, "inflate_", (int)errorCode, _zlibStream.GetErrorMessage());
264 default:
265 throw new ZLibException(System.SR.ZLibErrorUnexpected, "inflate_", (int)errorCode, _zlibStream.GetErrorMessage());
266 }
267 }
ZLibNative.ZLibStreamHandle _zlibStream
Definition Inflater.cs:15
static string UnsupportedCompression
Definition SR.cs:122
static string ZLibErrorNotEnoughMemory
Definition SR.cs:46
static string ZLibErrorDLLLoadError
Definition SR.cs:40
static string ZLibErrorInconsistentStream
Definition SR.cs:42
static string ZLibErrorUnexpected
Definition SR.cs:50
Definition SR.cs:7

References System.IO.Compression.Inflater._zlibStream, System.SR.UnsupportedCompression, System.SR.ZLibErrorDLLLoadError, System.SR.ZLibErrorInconsistentStream, System.SR.ZLibErrorNotEnoughMemory, and System.SR.ZLibErrorUnexpected.