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

◆ ReadAsyncInternal()

ValueTask< int > System.IO.Compression.DeflateManagedStream.ReadAsyncInternal ( Memory< byte > buffer,
CancellationToken cancellationToken )
inlineprivate

Definition at line 162 of file DeflateManagedStream.cs.

163 {
164 if (cancellationToken.IsCancellationRequested)
165 {
167 }
169 bool flag = false;
170 try
171 {
172 int num = _inflater.Inflate(buffer.Span);
173 if (num != 0)
174 {
175 return ValueTask.FromResult(num);
176 }
177 if (_inflater.Finished())
178 {
179 return ValueTask.FromResult(0);
180 }
182 flag = true;
183 return ReadAsyncCore(readTask, buffer, cancellationToken);
184 }
185 finally
186 {
187 if (!flag)
188 {
190 }
191 }
192 }
async ValueTask< int > ReadAsyncCore(ValueTask< int > readTask, Memory< byte > buffer, CancellationToken cancellationToken)
Task< int > ReadAsync(byte[] buffer, int offset, int count)
Definition Stream.cs:762
static int Decrement(ref int location)
static int Increment(ref int location)
static ValueTask FromCanceled(CancellationToken cancellationToken)
Definition ValueTask.cs:180

References System.IO.Compression.DeflateManagedStream._asyncOperations, System.IO.Compression.DeflateManagedStream._buffer, System.IO.Compression.DeflateManagedStream._inflater, System.IO.Compression.DeflateManagedStream._stream, System.buffer, System.cancellationToken, System.Threading.Interlocked.Decrement(), System.IO.Compression.InflaterManaged.Finished(), System.Threading.Tasks.ValueTask< TResult >.FromCanceled(), System.Threading.Interlocked.Increment(), System.IO.Compression.InflaterManaged.Inflate(), System.IO.Stream.ReadAsync(), and System.IO.Compression.DeflateManagedStream.ReadAsyncCore().

Referenced by System.IO.Compression.DeflateManagedStream.ReadAsync(), and System.IO.Compression.DeflateManagedStream.ReadAsync().