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

◆ Deflate()

ZLibNative.ErrorCode System.IO.Compression.Deflater.Deflate ( ZLibNative::FlushCode flushCode)
inlineprivate

Definition at line 173 of file Deflater.cs.

174 {
175 ZLibNative.ErrorCode errorCode;
176 try
177 {
178 errorCode = _zlibStream.Deflate(flushCode);
179 }
180 catch (Exception innerException)
181 {
182 throw new ZLibException(System.SR.ZLibErrorDLLLoadError, innerException);
183 }
184 switch (errorCode)
185 {
186 case ZLibNative.ErrorCode.Ok:
187 case ZLibNative.ErrorCode.StreamEnd:
188 return errorCode;
189 case ZLibNative.ErrorCode.BufError:
190 return errorCode;
191 case ZLibNative.ErrorCode.StreamError:
192 throw new ZLibException(System.SR.ZLibErrorInconsistentStream, "deflate", (int)errorCode, _zlibStream.GetErrorMessage());
193 default:
194 throw new ZLibException(System.SR.ZLibErrorUnexpected, "deflate", (int)errorCode, _zlibStream.GetErrorMessage());
195 }
196 }
readonly ZLibNative.ZLibStreamHandle _zlibStream
Definition Deflater.cs:7
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.Deflater._zlibStream, System.SR.ZLibErrorDLLLoadError, System.SR.ZLibErrorInconsistentStream, and System.SR.ZLibErrorUnexpected.