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

◆ InternalReadAllBytesAsync()

static async Task< byte[]> System.IO.File.InternalReadAllBytesAsync ( FileStream fs,
int count,
CancellationToken cancellationToken )
inlinestaticprivate

Definition at line 753 of file File.cs.

754 {
755 using (fs)
756 {
757 int index = 0;
758 byte[] bytes = new byte[count];
759 do
760 {
761 int num = await fs.ReadAsync(new Memory<byte>(bytes, index, count - index), cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
762 if (num == 0)
763 {
764 ThrowHelper.ThrowEndOfFileException();
765 }
766 index += num;
767 }
768 while (index < count);
769 return bytes;
770 }
771 }

References System.bytes, System.cancellationToken, System.count, System.index, and System.ThrowHelper.ThrowEndOfFileException().

Referenced by System.IO.File.ReadAllBytesAsync().