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

◆ Finish()

bool System.Net.WebSockets.Compression.WebSocketInflater.Finish ( Span< byte > output,
ref int written )
inlineprivate

Definition at line 122 of file WebSocketInflater.cs.

123 {
124 byte? remainingByte = _remainingByte;
125 if (remainingByte.HasValue)
126 {
127 if (output.Length == written)
128 {
129 return false;
130 }
131 output[written] = _remainingByte.GetValueOrDefault();
132 _remainingByte = null;
133 written++;
134 }
135 if (output.Length > written)
136 {
137 int num = written;
139 Span<byte> span = output;
140 written = num + Inflate(stream, span[written..], ZLibNative.FlushCode.SyncFlush);
141 }
142 if (written < output.Length || IsFinished(_stream, out _remainingByte))
143 {
144 if (!_persisted)
145 {
146 _stream.Dispose();
147 _stream = null;
148 }
149 return true;
150 }
151 return false;
152 }
unsafe bool Inflate(Span< byte > output, out int written)
static unsafe bool IsFinished(ZLibNative.ZLibStreamHandle stream, out byte? remainingByte)
int Length
Definition Span.cs:70

References System.Net.WebSockets.Compression.WebSocketInflater._persisted, System.Net.WebSockets.Compression.WebSocketInflater._remainingByte, System.Net.WebSockets.Compression.WebSocketInflater._stream, System.Net.WebSockets.Compression.WebSocketInflater.Inflate(), System.Net.WebSockets.Compression.WebSocketInflater.IsFinished(), System.Span< T >.Length, and System.stream.